Which user to install nodejs as ? Debian Linux
-
@toggledbits said in Which user to install nodejs as ? Debian Linux:
When backing up and restoring, the entire storage folder should always go as a unit. No cherry-picking
Understood now thanks.
I uploaded the file to your dropbox. Cheers for the help!
Btw I formatted everything and started again earlier, no longer using NVM to install node.js I installed it globally instead with apt via the command from this webpage here. That seems to have fixed my Node-Red service file issues anyways. Both MSR and Node-Red are auto starting at boot now.
@cw-kid said in Which user to install nodejs as ? Debian Linux:
I installed it globally instead with apt via the command from this webpage here.
Sigh. OK. Unfortunately, that version (20) is already out of development, but at least it's LTS and will hold until 2026. Or maybe the header on the page is wrong and it's been updated to install the latest LTS. Either way, Reactor will support it as long as it's under maintenance with the authors.
There's nothing wrong with your
expressions.json
file. I'm guessing it's a permissions problem after you copy it from whatever source you copied it from (it's keeping the user and group IDs on the file from whatever source, and the user ID has changed between the two systems).As I said, you should copy the entire
storage
directory, don't cherry pick, because there are other important files in there that align with your installation. Once you've copied everything, run the following commands in a shell from the Reactor install directory (where Reactor'sapp.js
is located), substituting<user>
and<group>
with the user and group names, respectively:sudo chown -R <user>:<group> . sudo chmod -R ug=rwX,o= .
This should fix all file permissions. Then start Reactor.
-
@cw-kid said in Which user to install nodejs as ? Debian Linux:
I installed it globally instead with apt via the command from this webpage here.
Sigh. OK. Unfortunately, that version (20) is already out of development, but at least it's LTS and will hold until 2026. Or maybe the header on the page is wrong and it's been updated to install the latest LTS. Either way, Reactor will support it as long as it's under maintenance with the authors.
There's nothing wrong with your
expressions.json
file. I'm guessing it's a permissions problem after you copy it from whatever source you copied it from (it's keeping the user and group IDs on the file from whatever source, and the user ID has changed between the two systems).As I said, you should copy the entire
storage
directory, don't cherry pick, because there are other important files in there that align with your installation. Once you've copied everything, run the following commands in a shell from the Reactor install directory (where Reactor'sapp.js
is located), substituting<user>
and<group>
with the user and group names, respectively:sudo chown -R <user>:<group> . sudo chmod -R ug=rwX,o= .
This should fix all file permissions. Then start Reactor.
I used WINSCP to copy the file from my Windows PC to the Linux box.
It says rw-r--r-- next to the expressions file and has me as the owner of the file.
Regarding nodejs installed via apt it says its version v20.18.1 I think version 22.x is the latest. Maybe I can upgrade it somehow later.
-
Yeah, but I can see in that screen shot that there are other broken permissions that are going to cause problems. For example, look at the
reactions
folder. It's owned by root, with no write permission for group or other users, so that's going to prevent you from saving new reactions, at least, and depending on individual file permissions within that folder, editing and saving any existing reactions. So I suspect the parent folderstorage
, and maybe even the Reactor install directory itself, have gotten broken permissions/ownership along the way of your efforts.You need to fix the entire directory tree to be safe, using the commands I gave you.
-
OK I ran these commands in the home/stuart/reactor folder where the app.js file is located. That appears to have worked and changed some of the folders and files from root to my name now.
Also after restarting MSR the expressions.json file is no longer changing from 9k to 1k in size and I can open the file from the Linux machine and see its contents are still all intact. It wasn't doing that before.
However in the MSR GUI in Expressions its still empty.
Edit I seem to have ballsed something up, i have a path now of /home/stuart/reactor/reactor hang on let me try and fix that.
-
Not sure how I ended up with a reactor folder in the reactor folder. I deleted it.
It now looks correct and I ran the commands again for the permssions.However every time I copy the expression file from the PC to the Linux box its 9k in file size. But when I restart MSR it changes that file to be 1k and wipes out all its contents.
-
Think I have got it working now!
I ran these commands again logged in as me.
cd /home/stuart
pkill -QUIT node
tar xzvf /home/stuart/reactor-latest-24302-751a06b6.tar.gz
sudo systemctl start reactorcd /home/stuart/reactor
npm i --no-save --omit devWill try and figure out how to update nodejs now from 20.x to 22.x.
-
It seems nodesource is just out of date and does not have the latest versions of nodejs
I tried this command instead and it still only wants to get version v20.18.1 as the latest one.
curl -fsSL https://deb.nodesource.com/setup_current.x | -E bash -
apt-get install -y nodejs
And when I run a "Which node" command its put it in this directory which I don't think is ideal?
/usr/bin/node
So now sure now the best way to update nodejs.
-
Frankly, I wouldn't update. The amount of changes you've made are making your entire system a moving target. You're good until 2026. Leave it alone for now. Get everything else working, and get it stable.
In the meanwhile, grab yourself a Pi or something else cheap that can run Linux, and practice. Install versions and get to know where things go and how they are connected together. Upgrade it. Blow it up, wipe it, and do it again until you understand why it blows up. The time you invest will pay you back later when you deal with your "production" system. Sandboxes are a lovely thing. Go play!
-
Ah this point, if I was you @cw-kid , I’ll start taking a look at docker. That’s exactly why they built it: to easily install and manage applications. Just backup your docker file and settings and you’ll move in seconds. I have a backup installation always ready on my synology and ready to run in minutes in case of problems.
-
Ah this point, if I was you @cw-kid , I’ll start taking a look at docker. That’s exactly why they built it: to easily install and manage applications. Just backup your docker file and settings and you’ll move in seconds. I have a backup installation always ready on my synology and ready to run in minutes in case of problems.
@therealdb I have the hardware, just haven't had the time yet, to do exactly this.
-
T toggledbits unlocked this topic on
-
T toggledbits locked this topic on