That is the solution. Add --node16 to the end of the bash <(curl... command (after a space) and it will remove the old version of nodejs and install the new one.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16
or you could go for version 18, but it is still quite new and there may still be a few contrib nodes that are not happy with that version.
Thanks colin. I chose to remain with version 16 and installed node red. But the core component had a red cross mark across it. Is that a concern?
Running Node-RED install for user srikumar at /home/srikumar on raspbian
This can take 20-30 minutes on the slower Pi versions - please wait.
Stop Node-RED
Remove old version of Node-RED
Remove old version of Node.js v12.22.12
Install Node.js 16 LTS v16.18.1 Npm 8.19.2
Clean npm cache
Install Node-RED core ā 3.0.2
Move global nodes to local -
Npm rebuild existing nodes
Install extra Pi nodes
Add shortcut commands
Update systemd script
Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880
Started : Fri 09 Dec 2022 07:19:09 PM IST
Finished: Fri 09 Dec 2022 07:26:51 PM IST
WARNING
DO NOT EXPOSE NODE-RED TO THE OPEN INTERNET WITHOUT SECURING IT FIRST
Even if your Node-RED doesn't have anything valuable, (automated) attacks will
happen and could provide a foothold in your local network
Follow the guide at Securing Node-RED : Node-RED
to setup security.
ADDITIONAL RECOMMENDATIONS
-
Remove the /etc/sudoers.d/010_pi-nopasswd file to require entering your password
when performing any sudo/root commands:sudo rm -f /etc/sudoers.d/010_pi-nopasswd
-
You can customise the initial settings by running:
node-red admin init
-
After running Node-RED for the first time, change the ownership of the settings
file to 'root' to prevent unauthorised changes:sudo chown root:root ~/.node-red/settings.js
Would you like to customise the settings now (y/N) ?
I tried node-red-start from terminal and it came up with the message below;
srikumar@raspberrypi:~ $ node-red-start
Node-RED is not yet fully installed. Please re-run the install script again manually.
"--------....................raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)"
then retry node-red-start
Ran the script once again. The installation seems to have gone through without any issues. Will get back in case of any issues.
Thanks to Node red, specifically Colin for the excellent support. thanks also to Paul-Reed and jbudd.
Look in that file. If necessary post it here. If it contains multiple install attempts just post the last one. Copy/paste the contents here.
This is the last installation log.....(removed reference to HTTP:// in some of the links below replaced it with dots to comply with the requirements of the forum)
Started : Fri 09 Dec 2022 07:38:36 PM IST
Running for user srikumar at /home/srikumar
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 0 not upgraded.
Installing nodejs 16
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
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 120 MB disk space will be freed.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 130957 files and directories currently installed.)
Removing nodejs (16.18.1-deb-1nodesource1) ...
Processing triggers for man-db (2.9.4-2) ...
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Grab the LTS bundle
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.74.0-1.3+deb11u3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Installing the NodeSource Node.js 16.x repo...
Populating apt-get cache...
- apt-get update
Hit:1 ..................deb.nodesource.com/node_16.x bullseye InRelease
Hit:2 ...........................rchive.raspberrypi.org/debian bullseye InRelease
Hit:3 ..............................raspbian.raspberrypi.org/raspbian bullseye InRelease
Reading package lists...
Confirming "bullseye" is supported...
- curl -sLf -o /dev/null '.......................deb.nodesource.com/node_16.x/dists/bullseye/Release'
Adding the NodeSource signing key to your keyring...
- curl -s ...................deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
Creating apt sources list file for the NodeSource Node.js 16.x repo...
- echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] ................deb.nodesource.com/node_16.x bullseye main' > /etc/apt/sources.list.d/nodesource.list
- echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] ............deb.nodesource.com/node_16.x bullseye main' >> /etc/apt/sources.list.d/nodesource.list
Running apt-get update
for you...
- apt-get update
Hit:1 ................./raspbian.raspberrypi.org/raspbian bullseye InRelease
Hit:2 .........................archive.raspberrypi.org/debian bullseye InRelease
Hit:3 ...............deb.nodesource.com/node_16.x bullseye InRelease
Reading package lists...
Run sudo apt-get install -y nodejs
to install Node.js 16.x and npm
You may also need development tools to build native addons:
sudo apt-get install gcc g++ make
To install the Yarn package manager, run:
curl -sL .......dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
echo "deb [signed-by......................../usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 24.2 MB of archives.
After this operation, 120 MB of additional disk space will be used.
Get:1 Index of /node_16.x/ bullseye/main armhf nodejs armhf 16.18.1-deb-1nodesource1 [24.2 MB]
Fetched 24.2 MB in 3min 13s (126 kB/s)
Selecting previously unselected package nodejs.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 127752 files and directories currently installed.)
Preparing to unpack .../nodejs_16.18.1-deb-1nodesource1_armhf.deb ...
Unpacking nodejs (16.18.1-deb-1nodesource1) ...
Setting up nodejs (16.18.1-deb-1nodesource1) ...
Processing triggers for man-db (2.9.4-2) ...
Versions: node:v16.18.1 npm:8.19.2
npm WARN using --force Recommended protections disabled.
Now install Node-RED
added 292 packages in 3m
3.0.2
Now create basic package.json for the user and move any global nodes
Running npm rebuild
rebuilt dependencies successfully
Installing extra nodes: node-red-node-pi-gpio@latest node-red-node-random@latest node-red-node-ping@latest node-red-contrib-play-audio@latest node-red-node-smooth@latest node-red-node-serialport@latest node-red-contrib-buffer-parser@latest :
up to date in 4s
Now add the shortcut and start/stop/log scripts to the menu
Now add systemd script and configure it for srikumar:srikumar @ /home/srikumar
ln: failed to create symbolic link '/usr/bin/python': File exists
Now add launcher to top bar, add cpu temp example, make sure ping works
The user srikumar' is already a member of
gpio'.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
python3-rpi.gpio is already the newest version (0.7.0-0.2+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Allow binding to low ports : n
Memory : 7.8G
Started : Fri 09 Dec 2022 07:38:36 PM IST
Finished: Fri 09 Dec 2022 07:46:03 PM IST
I don't think that is the run that failed, as it appears to have installed node-red with no problems.
Here is the portion related to the earlier attempt -
OLD nodejs 0 :
NEW nodejs :
***************************************
,,,`Preformatted text`
'''Started : Fri 09 Dec 2022 04:28:28 PM IST
Running for user srikumar at /home/srikumar
Failed to stop nodered.service: Unit nodered.service not loaded.
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
The following packages were automatically installed and are no longer required:
libbasicusageenvironment1 libfuse2 libgroupsock8 liblivemedia77
libusageenvironment3
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Installing nodejs 16
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libbasicusageenvironment1 libfuse2 libgroupsock8 liblivemedia77
libusageenvironment3
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg: warning: ignoring request to remove nodejs which isn't installed
dpkg: warning: ignoring request to remove node which isn't installed
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
libbasicusageenvironment1 libfuse2 libgroupsock8 liblivemedia77
libusageenvironment3
0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
After this operation, 1,372 kB disk space will be freed.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 127789 files and directories currently installed.)
Removing liblivemedia77:armhf (2020.01.19-1+build1) ...
Removing libgroupsock8:armhf (2020.01.19-1+build1) ...
Removing libbasicusageenvironment1:armhf (2020.01.19-1+build1) ...
Removing libfuse2:armhf (2.9.9-5) ...
Removing libusageenvironment3:armhf (2020.01.19-1+build1) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...
Grab the LTS bundle
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.74.0-1.3+deb11u3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
## Installing the NodeSource Node.js 16.x repo...
## Populating apt-get cache...
+ apt-get update
Err:1...........................aspbian.raspberrypi.org/raspbian bullseye InRelease
Temporary failure resolving 'raspbian.raspberrypi.org'
Err:2 .......................archive.raspberrypi.org/debian bullseye InRelease
Temporary failure resolving 'archive.raspberrypi.org'
Reading package lists...
W: Failed to fetch ......:/raspbian.raspberrypi.org/raspbian/dists/bullseye/InRelease Temporary failure resolving 'raspbian.raspberrypi.org'
W: Failed to fetch ....../archive.raspberrypi.org/debian/dists/bullseye/InRelease Temporary failure resolving 'archive.raspberrypi.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
## Confirming "bullseye" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_16.x/dists/bullseye/Release'
## Your distribution, identified as "bullseye", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
libc-ares2 libjs-highlight.js libnode72 nodejs-doc
Suggested packages:
npm
The following NEW packages will be installed:
libc-ares2 libjs-highlight.js libnode72 nodejs nodejs-doc
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.5 MB of archives.
After this operation, 45.6 MB of additional disk space will be used.
Get:1 ......./raspbian.raspberrypi.org/raspbian bullseye/main armhf libc-ares2 armhf 1.17.1-1+deb11u1 [96.0 kB]
Get:2 ....../raspbian.raspberrypi.org/raspbian bullseye/main armhf libjs-highlight.js all 9.18.5+dfsg1-1 [397 kB]
Get:3 ......raspbian.raspberrypi.org/raspbian bullseye/main armhf libnode72 armhf 12.22.12~dfsg-1~deb11u1 [7,263 kB]
Get:4 ......raspbian.raspberrypi.org/raspbian bullseye/main armhf nodejs armhf 12.22.12~dfsg-1~deb11u1 [147 kB]
Get:5 ........raspbian.raspberrypi.org/raspbian bullseye/main armhf nodejs-doc all 12.22.12~dfsg-1~deb11u1 [2,547 kB]
Fetched 10.5 MB in 35s (302 kB/s)
Selecting previously unselected package libc-ares2:armhf.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 127752 files and directories currently installed.)
Preparing to unpack .../libc-ares2_1.17.1-1+deb11u1_armhf.deb ...
Unpacking libc-ares2:armhf (1.17.1-1+deb11u1) ...
Selecting previously unselected package libjs-highlight.js.
Preparing to unpack .../libjs-highlight.js_9.18.5+dfsg1-1_all.deb ...
Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ...
Selecting previously unselected package libnode72:armhf.
Preparing to unpack .../libnode72_12.22.12~dfsg-1~deb11u1_armhf.deb ...
Unpacking libnode72:armhf (12.22.12~dfsg-1~deb11u1) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_12.22.12~dfsg-1~deb11u1_armhf.deb ...
Unpacking nodejs (12.22.12~dfsg-1~deb11u1) ...
Selecting previously unselected package nodejs-doc.
Preparing to unpack .../nodejs-doc_12.22.12~dfsg-1~deb11u1_all.deb ...
Unpacking nodejs-doc (12.22.12~dfsg-1~deb11u1) ...
Setting up libc-ares2:armhf (1.17.1-1+deb11u1) ...
Setting up libnode72:armhf (12.22.12~dfsg-1~deb11u1) ...
Setting up libjs-highlight.js (9.18.5+dfsg1-1) ...
Setting up nodejs (12.22.12~dfsg-1~deb11u1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
Setting up nodejs-doc (12.22.12~dfsg-1~deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...
Versions: node:v12.22.12 npm:missing
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs :
Nodejs 12 too old and new version not specified - exiting
Already have nodejs v12.22.12
OLD nodejs 12 :
NEW nodejs 16 :
Installing nodejs 16 over 12 .
**********************************'''
Often informative errors can be seen from looking at logs, though often there is so much output it is difficult to identify the important stuff. It appears that there was a DNS problem of some sort so it was not possible to access the repository. When you ran the script again later it had recovered so the script completed ok.
Thanks Colin for troubleshooting the issue.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.