Asking about the new versions - just to be sure

Ok, Nic' has just announced the new version releases of NR.

I am sticking with 4.x and have 4.0.9 Buster and NodeJS 18.20.8

How do I update?
My efforts so far have yielded:

node-red-stop
sudo npm install -g --unsafe-perm node-red
node-red --version
node-red-start

The version should show me 4.1.13

Thanks in advance.

I'm guessing I may not need the sudo if they are installed via the usual install script.

I think you need to use...
sudo npm install -g --unsafe-perm node-red@4.1.13
to get a specific version installed.

If you use...
sudo npm install -g --unsafe-perm node-red
you will get the latest version of Node-RED which currently is 5.0.4

That's why I ask.

:wink:

Not sure this is good.

 sudo npm install -g --unsafe-perm node-red@4.1.13
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'validate-npm-package-name@7.0.2',
npm warn EBADENGINE   required: { node: '^20.17.0 || >=22.9.0' },
npm warn EBADENGINE   current: { node: 'v18.20.8', npm: '10.8.2' }
npm warn EBADENGINE }

added 18 packages, removed 15 packages, and changed 263 packages in 2m

79 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New major version of npm available! 10.8.2 -> 12.0.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v12.0.2
npm notice To update run: npm install -g npm@12.0.2
npm notice
pi@BedPi:~/.node-red $ node-red --version
Node-RED v4.1.13
Node.js v18.20.8
Linux 5.10.103-v7+ arm LE
pi@BedPi:~/.node-red $ npm install -g npm@12.0.2
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: npm@12.0.2
npm error notsup Not compatible with your version of node/npm: npm@12.0.2
npm error notsup Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v18.20.8"}
npm error A complete log of this run can be found in: /home/pi/.npm/_logs/2026-07-31T06_44_47_659Z-debug-0.log
pi@BedPi:~/.node-red $ cd ~/.npm/
pi@BedPi:~/.npm $ cd _logs
pi@BedPi:~/.npm/_logs $ cat 2026-07-31T06_44_47_659Z-debug-0.log 
0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@10.8.2
2 info using node@v18.20.8
3 silly config load:file:/usr/lib/node_modules/npm/npmrc
4 silly config load:file:/home/pi/.npmrc
5 silly config load:file:/usr/etc/npmrc
6 verbose title npm install npm@12.0.2
7 verbose argv "install" "--global" "npm@12.0.2"
8 verbose logfile logs-max:10 dir:/home/pi/.npm/_logs/2026-07-31T06_44_47_659Z-
9 verbose logfile /home/pi/.npm/_logs/2026-07-31T06_44_47_659Z-debug-0.log
10 silly logfile start cleaning logs, removing 1 files
11 silly logfile done cleaning log files
12 http fetch GET 200 https://registry.npmjs.org/npm 1856ms (cache miss)
13 verbose stack Error: Unsupported engine
13 verbose stack     at Object.checkEngine (/usr/lib/node_modules/npm/node_modules/npm-install-checks/lib/index.js:14:25)
13 verbose stack     at Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:113:16)
13 verbose stack     at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
13 verbose stack     at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5)
14 verbose pkgid npm@12.0.2
15 error code EBADENGINE
16 error engine Unsupported engine
17 error engine Not compatible with your version of node/npm: npm@12.0.2
18 error notsup Not compatible with your version of node/npm: npm@12.0.2
18 error notsup Required: {"node":"^22.22.2 || ^24.15.0 || >=26.0.0"}
18 error notsup Actual:   {"npm":"10.8.2","node":"v18.20.8"}
19 verbose cwd /home/pi/.node-red
20 verbose os Linux 5.10.103-v7+
21 verbose node v18.20.8
22 verbose npm  v10.8.2
23 verbose exit 1
24 verbose code 1
25 error A complete log of this run can be found in: /home/pi/.npm/_logs/2026-07-31T06_44_47_659Z-debug-0.log

Buster
RasPi 2 I think.
NR not running just now.
Shall try and update.

Seems to be working.

Think I got same npm warnings when I updated, although Node-RED seems to work just fine.

Not to bait you, but if I installed NR via the normal script.....
on a Pi.....

Do I need the sudo?
I thought NR was run as the user, not root.

Correct. You don’t need sudo with the script. It will do that for you as necessary.
(but that is not what you have shown above)

Just out-of-interest - what version of OS are you running?
I assume you are running on a RPi ?
Older versions like Buster won't work as 32-bit support has been dropped.
You really need to be running Bookworm OS.

It is run as user, but you need sudo to install it globally. Just like installing most other s/w on the pi.

[Edit] but you don't need to use sudo with the bash script as the script adds the sudo for the required commands for you, which is why you have to enter your password when you run the script (assuming that passwords for sudo have not been disabled).

Ignore the npm warning, you can’t use the latest npm with that outdated version of node.js.

I would say that the other issue is a node-red bug because I think v4.* is supposed to be baselined against node.js v18.

But, node.js v18 it’s beyond end of life. If your os supports it, you should upgrade anyway. Certainly, you should not let anything that outdated be exposed to the internet.

ISTR from another thread his Buster OS doesn't support later nodejs due to libc/gcc changes etc...

(4.1.11 install question - #21 by dceejay)

Buster.

It won't take take the 64 bit version. Busteris 32 bit - yes?

Alas it isn't that simpel to just update.

I have 3 * RasPi working.

Another..... (few) not. All on Buster.

This machine is Ubuntu 22.04 and I would have to update ALL of them as the VNC client/thing is not compatible.

So it is something I may (eventually) hve to do. But am not looking forward to and don't have the confidence to start/try it.
As if I start I MUST finish.

So..... It works. I'm not going to change it.

None of my machines are.

I don't have any ports to them open.

But thanks.

So - again for clarity:

node-red-stop
sudo npm install -g --unsafe-perm node-red@4.1.13
node-red --version
node-red-start

and should I do the npm update or not?
As per:
npm install -g npm@12.0.2

Not. It will probably fail on node.js v18 anyway.

Isn't the issue here that, apparently, 4.1.13 asks for at least nodejs 20 whereas it should be asking for at least 18?

The problem is the validate-npm-package-name library. If someone is running 4.1.13, they can check what is requiring that node.

v5 has this dependency chain:

v4, I think, needs to depend on an earlier version of npm? No, it has a direct dependency on validate-npm-package-name v7.0.2. That version has this: "node": "^20.17.0 || >=22.9.0" which is at odds with node-red's base node.js version. It needs to use v6.0.2 which is the last version supporting node.js v18: