How do I update to node >14.0.0?

My setup is RPI-4B
VERSION="10 (buster)"
NR: v3.0.2
node: 12.22.12
npm: 6.14.16

I'm trying to install some new nodes in NR v3.0.2 and get a message saying I need node.js >14.0.0

I've tried various scripts to update node.js - but had zero success.

Could someone point me to where I can find some official instructions on how to do this?

If you use the official install script put --node14 or --node16 at end and it will install that node version for you
[Edit ] that's two dashes

I tried that and still ended-up with version 12.
I'll try it again - just to make sure it wasn't finger trouble.

Do you mean this command line instruction??
If so, I've just tried it and it remains at v12.22.12

sudo npm install -g --unsafe-perm node-red --node16

I have managed to update npm to 8.19.2

Not that, use the bash command

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

And add a space then —node16

Note: I did this from my phone and the two dash’s come out looking like a solid line

too slow, what @zenofmud said, doesn't hurt your node red install or flows, will just update node js, assuming you have the latest node red install already
[edit] that's what took me so long, had to fire up laptop to look for whole bash command, was using phone too

Thanks guys - just tried that. Still node.js 12.22.12 even though the script said installing v16
update
restart
It's also reverted to npm 6.14.16

Is the issue related to the fact that I'm using Buster - which is not the latest OS release ??

Are you using the
node -v command?

Yep

node_V

That is poor. The current LTS for node-red is 14 isn't it? You shouldn't really need to go beyond that unless you are testing something that will be introduced when node-red v4 is published.

Have you used n or nvm at all?

If you have any gasoline pour a cup on the board and apply lit match. Otherwise you are going to have to wait for a better mind than mine, that's all I got.

I tried --node14 earlier, and got the same result.

Can you elaborate a bit more for me?

Thanks for your help anyway.

I'm afraid that this is why I don't use things like Dave's excellent script. I'd rather understand and be able to take direct control. I use the node.js Debian repo so I can update with just sudo apt update && sudo apt upgrade with a major version upgrade just needing a changeover of the repo.

They are node.js version managers. Let you have multiple versions installed and switch between them. Causes all manner of confusion.

Just tried the official script with --node14 at the end.
Still no success, even though the script says it is installing 14 LTS
update_v14

Try doing:

home@home:~$ whereis node.js
node: /usr/bin/node /usr/include/node /usr/share/man/man1/node.1.gz

See if it throws up some additional versions

Have a look at the nodered-install.log , this should reveal the problem.

There is this line in the log - is that relevant?

Confirming "" is supported...

Your distribution, identified as "", is not currently supported, please contact NodeSource at Issues · nodesource/distributions · GitHub if you think this is incorr$

Here's the first part of the log file. Not sure what to do next..

Already have nodejs v16.15.0
OLD nodejs 16 :
NEW nodejs 14 :


Started : Thu 29 Sep 14:20:58 BST 2022
Running for user pi at /home/pi
Found global nodes: :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 159 not upgraded.
Installing nodejs 14

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
nodejs
Traceback (most recent call last):
File "/usr/bin/apt-listchanges", line 30, in
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
0 upgraded, 0 newly installed, 1 to remove and 158 not upgraded.
After this operation, 115 MB disk space will be freed.
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading database$
Removing nodejs (16.15.0-deb-1nodesource1) ...
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/docs/output/using-npm' not empty so not removed
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/emoji-regex' not empty so not removed
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/@tootallnate/once' not empty so not removed
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/brace-expansion' not empty so not removed