Tidied up Install script for v5

The current install script has done a fair few rounds, so I have had a go at tidying it up somewhat - to get rid of some of the old cruft that had accumulated along the way - and to make it more ready for v5 (ie node 22 onwards) - default to 24 . etc

As it has had a fair few changes I "think" I have tested most of the pathways and platforms - but of course you lot are pretty darn good at finding the flaws... so I'm not going to just replace the old one just yet...

The new one can be found at https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered
or

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered)

as usual you can add --help for more info on options etc...
Default will still install Node-RED 4.x - but you can try the beta with

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered) --nodered-version="next"

I would love to get feedback on any bugs, hangs, weird behaviour - but please don't try this on your golden device... just in case :slight_smile:

Thanks in advance

The script did not ask me if I wanted to install Pi specific nodes (I never do since I don't use the GPIO pins on my Pies) but it installed them anyway.

It did not give me the usual advice on securing Node-Red, nor comment about my unencrypted flows_cred.json and non-standard settings.js.

Just before running it I edited the systemd service script but did not run daemon-reload.
The warning about this was included in nodered-install.log but not output to the terminal.

Similarly, the warning about a customised systemd script was only in the logfile (not sure if this is a problem or not)

Correct, it no longer asks about pi nodes.
If it detects it's already running as a service it doesn't do the extra advice piece etc and settings and just restarts the service for less downtime.

No problems with an RPI5, but on RPI4 the node.js version was too low, so couldn't start.
Removed node.js and ran install again, now up and running on both RPI's.
I don't use PI nodes either.

running it to (re)install beta with --node24 (upgrade from v22) option as well and it appear to have frozen. I ctrl-c and started again - frozen again

1st time I ran it - it asked for sudo password - don't remember having to do that in the past

ctrl-c again and just ran basic script without any extras and it appeared to work

[edit]
re-ran with beta command and all OK

[edit2] for ref - this was the one that failed
image

Thanks. Will investigate

Hi all,

I have now restored the skip-pi nodes capability, and fixed the hang on upgrade issue.

New version is still at
https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered
if anyone wants to try it and let me know any other issues etc,

Thanks

  • For some reason it does not detect an existing node.js
  • The first time through debian wanted the user password - which I don't remember happening before but is probably a good idea
  • All the warnings are gone?
  • I installed node.js v26 (which is not mentioned in the help) and it is fine (I want to try the new Temporal API)
  • I also installed the Beta

All from the bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered) --nodered-version="next" as given at the top.

So far everything is going well

It seems quite handy to know how my systemd script differs from the latest, so i did sudo systemctl disable nodered before running
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/refs/heads/master/deb/install-update-nodered) --nodered-version="next"

The install process was surprisingly fast (Pi Zero 2: 3m,6s).

At the end I saw the expected prompt

Just FYI : Your settings.js file is different from the latest defaults.
Would you like me to backup your ex, isting settings.js and try to merge it with the new version ? (y/N) ? You may wish to run
   diff -y -w --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js
to compare them and see what the latest options are.

But I was not loitering in that terminal for the script to finish, and after a period (10 sec?) it stopped waiting. I don't know what it did but it didn't give me a diff output

  1. At the beginning it tells you existing node.js and npm versions installed. This would be better before confirming you want to continue? Since node-red --version is available it could also say if Node-red is pre-installed and version.

  2. I think it would be handy to offer at the beginning "Do you want to disable your systemd script and see it's differences from the latest version?"

  3. It's great for a complex script to offer interaction, but really confusing if it offers a prompt but them makes it's own decision without explaining. Please at least say "I gave up waiting, you can do this stage manually by ... at the command line"

Thanks,
re 3 - I think that is just a formatting error for the text when you don't respond. - It should say
"You may wish to run"
" diff -y -w --suppress-common-lines /usr/lib/node_modules/node-red/settings.js /home/pi/.node-red/settings.js"
"to compare them and see what the latest options are."

on a separate line so it would be clearer that you could do that afterwards if you wanted.

re 2 - not thought about systems tbh. I'm trying to make the script simpler not more complex :slight_smile:

I don't seem to have been making much sense when I last commented, clearly getting nodered.service and settings.js somewhat confused.

I blame the heat!

So looking again:

Before starting to install

The information line Node.js v24.13.0 and Npm 11.6.2 already installed. would be useful before typing Y to do the install.

At the same time, the installed Node-red version (if any) should be shown, and possibly whether it is running, since this impacts the handling of settings.js.

Handling of settings.js

If Node-red is not running

The script checks for non-standard settings.js and issues the Just FYI lines. `This output is not included in the log file`, in contrast to notification of a non-standard service file. The script asks if it should attempt a merge, with a timeout. Output from the merge script is sent to the screen, Would it be better saved in the log file, and screen output limited to "Your settings.js file was/was not modified"?

If Node-red is running

The check is not done, which seems odd. It surely takes very little time to compare the two settings files, even if to reduce delay you are not going to offer to try and merge them. The log file really should include the info that a non standard settings file was found.

Merged file

My settings file has two custom sections, one above module.exports and one in editorTheme.. Each is wrapped in comment lines for documentation purposes
// ----------- added by script ----------

...

// --------------------------------------

The comments do not get copied to the merged file.

Handling of nodered.service

If a nodered.service file already exists and is different from the current standard version, the screen output and log file notify this, and the downloaded version is then deleted.

The already installed file is, rightly, not modified.

Maybe, since it is quite short, the downloaded version, or a diff -y -w output could be included in the log so we can judge whether to change it?

"Fixup Pi tweaks"

I think this is a new feature in the script output? It’s not obvious what it refers to.