How do I update to node >14.0.0?

Drastic. But.
If you remove existing nodejs first then run the script
Eg. sudo apt purge nodejs npm
Check that node -v doesn’t see it anymore
Then use the script to reinstall

PS Julian if the pi is arm 7 based the the script does install the nodesource version of nodejs so apt will update it within minor version upgrades.

Followed your instructions to the letter. Although I asked for node14, it installed version16 - is that OK ??
update_v16

As long as it works :sweat_smile:

Well it doesn't. This all started as I was trying to update a node from the palette manager.
This is what I get when I try to update BigTimer or in fact any other node.

2022-09-29T16:02:08.111Z Install : node-red-contrib-bigtimer 2.8.3

2022-09-29T16:02:08.048Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-bigtimer@2.8.3

2022-09-29T16:02:09.274Z [err] npm

2022-09-29T16:02:09.275Z [err] WARN

2022-09-29T16:02:09.275Z [err] config production Use --omit=dev instead.

2022-09-29T16:02:12.291Z [err] (node:12907) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

2022-09-29T16:02:12.291Z [err] (Use node --trace-warnings ... to show where the warning was created)

2022-09-29T16:02:15.795Z [err] npm ERR!

2022-09-29T16:02:15.796Z [err] code ERESOLVE

2022-09-29T16:02:15.805Z [err] npm

2022-09-29T16:02:15.805Z [err] ERR! ERESOLVE could not resolve

2022-09-29T16:02:15.805Z [err] npm

2022-09-29T16:02:15.806Z [err]

2022-09-29T16:02:15.806Z [err] ERR!

2022-09-29T16:02:15.806Z [err] npm ERR!

2022-09-29T16:02:15.806Z [err] While resolving: node-red-contrib-ui-mp4frag@0.1.0-beta.3

2022-09-29T16:02:15.806Z [err] npm ERR! Found: node-red-dashboard@3.1.7

2022-09-29T16:02:15.806Z [err] npm

2022-09-29T16:02:15.807Z [err] ERR!

In the .node-red dir I would run npm cache clear —force then npm rebuild

1 Like

I have seen problems such as you are having caused by out of date packages, or problems with the pi repositories. I suggest running
sudo apt update
and see if there are any errors. If not then run
sudo apt full-upgrade
to make sure all your packages are up to date.

Also show us what this gives
apt policy nodejs

1 Like

I probably should remember that, I'm sure you've said it before :slight_smile: and I should have anticipated that you would do it the "right" way anyway! :rofl:

I don't think I saw an answer to that one? But perhaps things have moved on anyway.

1 Like

I have node v16 installed on my live home Debian server and it works absolutely fine. I also use v16 on my Windows dev PC. I note that you even have v16.17.1 which I think came out in the last day or 2 last Friday.

1 Like

Not to hijack this thread but..... I have the same problem @dynamicdave has when I try to update any node in palette manager. Specifically trying to go from 3.17 to 3.2 on node-red-dashboard, but the same issue arises when I try to update any node from palette manager. The system errors, won't update. I keep my system, PI4 raspbian up to date with all updates and nothing seems to fix this error on my system either.
[edit] One further note for @dynamicdave - I accidentally updated one system to node 18 (as far as I can remember) and a lot seemed to quit working in node red. Rolled back to ver 16.something and it seems everything worked fine again. So ver 16.X should be OK in my limited experience.
[next edit]

2022-09-29T22:40:38.846Z Install : node-red-dashboard 3.2.0

2022-09-29T22:39:11.347Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-dashboard@3.2.0

2022-09-29T22:39:12.629Z [err] npm

2022-09-29T22:39:12.630Z [err]

2022-09-29T22:39:12.630Z [err] WARN config production Use --omit=dev instead.

2022-09-29T22:39:15.447Z [err] npm

2022-09-29T22:39:15.448Z [err] ERR! code ENOTEMPTY

2022-09-29T22:39:15.448Z [err] npm ERR!

2022-09-29T22:39:15.448Z [err] syscall rename

2022-09-29T22:39:15.448Z [err] npm

2022-09-29T22:39:15.448Z [err] ERR! path /home/pi/.node-red/node_modules/node-red-node-email

2022-09-29T22:39:15.449Z [err] npm ERR!

2022-09-29T22:39:15.449Z [err] dest /home/pi/.node-red/node_modules/.node-red-node-email-eJQ2YdZ0

2022-09-29T22:39:15.451Z [err] npm ERR! errno -39

2022-09-29T22:39:15.453Z [err] npm ERR!

2022-09-29T22:39:15.453Z [err] ENOTEMPTY: directory not empty, rename '/home/pi/.node-red/node_modules/node-red-node-email' -> '/home/pi/.node-red/node_modules/.node-red-node-email-eJQ2YdZ0'

2022-09-29T22:39:15.456Z [err]

2022-09-29T22:39:15.457Z [err] npm

2022-09-29T22:39:15.457Z [err] ERR! A complete log of this run can be found in:

2022-09-29T22:39:15.457Z [err] npm ERR! /home/pi/.npm/_logs/2022-09-29T22_39_12_543Z-debug-0.log

2022-09-29T22:39:15.474Z rc=217

There were a bunch of reports recently of ENOTEMPTY errors when trying to install node-red-node-email.
For example https://discourse.nodered.org/t/enotempty-when-installing-node-from-palette-since-nodered-3-0-directory-not-empty/65968
(And it happened to me yesterday too, deleting the named directory fixed it)

I don't think it's the same issue as DynamicDave's.

2 Likes

This is the result I get... Is it what you expected?

pi@dev-super-server:~/.node-red $ apt policy nodejs
nodejs:
Installed: 16.17.1-deb-1nodesource1
Candidate: 16.17.1-deb-1nodesource1
Version table:
*** 16.17.1-deb-1nodesource1 500
500 Index of /node_16.x/ buster/main armhf Packages
100 /var/lib/dpkg/status
10.24.0~dfsg-1~deb10u1 500
500 Index of /raspbian buster/main armhf Packages

1 Like

Don't forget that you also need to do an npm rebuild on all installed node.js packages after a major upgrade. That forces any C++ libraries to be rebuilt which is sometimes needed.

Yes, that is as it should be.

Did the update and full-upgrade run without errors?

(Sorry, but this is why I am still fence sitting on updating from 22.x)

What has that got to do with this thread?

I would not like to start/try to update and have it crash as what I understand happened in this case.

I just did an install of node-red-contrib-bigtimer on a Pi4 NR v3.02, node.js v14.20.0 and it installed fine:

-----------------------------------------------------------
2022-09-30T08:31:21.075Z Install : node-red-contrib-bigtimer 2.8.3

2022-09-30T08:31:21.284Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-bigtimer@2.8.3
2022-09-30T08:31:27.511Z [out] + node-red-contrib-bigtimer@2.8.3
2022-09-30T08:31:27.511Z [out] added 2 packages from 2 contributors in 4.465s
2022-09-30T08:31:27.535Z rc=0

I then ran the bash script with --node16 and started NR. It shows I'm at node.js v16.17.1

**pi@argonpi**:**~ $** node-red
30 Sep 04:37:23 - [info]
Welcome to Node-RED
===================
30 Sep 04:37:23 - [info] Node-RED version: v3.0.2
30 Sep 04:37:23 - [info] Node.js version: v16.17.1
30 Sep 04:37:23 - [info] Linux 5.10.103-v7l+ arm LE
30 Sep 04:37:24 - [info] Loading palette nodes
30 Sep 04:37:26 - [info] Dashboard version 3.1.5 started at /ui
30 Sep 04:37:26 - [info] Settings file : /home/pi/.node-red/settings.js
30 Sep 04:37:27 - [info] Context store : 'default' [module=memory]
30 Sep 04:37:27 - [info] User directory : /home/pi/.node-red
30 Sep 04:37:27 - [info] Projects directory: /home/pi/.node-red/projects
30 Sep 04:37:27 - [info] Server now running at http://127.0.0.1:1880/
30 Sep 04:37:27 - [info] Active project : project-1
30 Sep 04:37:27 - [info] Flows file : /home/pi/.node-red/projects/project-1/flows.json
30 Sep 04:37:27 - [warn] Using unencrypted credentials
30 Sep 04:37:27 - [info] Starting flows
30 Sep 04:37:27 - [info] Started flows

So I used the palette manager to remove then install node-red-contrib-bigtimer and everything worked fine.

-----------------------------------------------------------
2022-09-30T08:37:59.419Z Remove : node-red-contrib-bigtimer

2022-09-30T08:37:59.598Z npm remove --no-audit --no-update-notifier --no-fund --save node-red-contrib-bigtimer
2022-09-30T08:38:01.995Z [out] 
2022-09-30T08:38:01.995Z [out] removed 2 packages in 1s
2022-09-30T08:38:02.011Z rc=0

-----------------------------------------------------------
2022-09-30T08:38:10.634Z Install : node-red-contrib-bigtimer 2.8.3

2022-09-30T08:38:10.750Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-bigtimer@2.8.3
2022-09-30T08:38:11.944Z [err] npm
2022-09-30T08:38:11.945Z [err]  
2022-09-30T08:38:11.945Z [err] WARN config production Use `--omit=dev` instead.
2022-09-30T08:38:13.522Z [out] 
2022-09-30T08:38:13.522Z [out] added 2 packages in 2s
2022-09-30T08:38:13.536Z rc=0

I suspect Dave's issue has something to do with the clarify node

I think you are mixing this up with a different thread.

The Raspberry-Pi Homepage, hosting the images, gives the following information:
latest version of 32bit OS (Release Notes): 2022-09-22:

  • NodeRED removed from Recommended Software and full image - should only be installed via apt
    The 64 bit version is also affected.

When i tried to install it via software tool, i found, that only the version 12 of nodejs is in the list. The usual script denies installing nodered since version12 is no longer supported.

What i found and it worked for me (64bit Version):
sudo su
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

Then, as user pi, sudo apt install nodejs
After that i used the normal script bash <(curl -sL ....
Node-red version 3 is running, also the command sudo systemctl enable nodered.service works, after node-red was started for at least one time.