Just had a chance to try this now. Using restored system (so the same starting point as all the other attempts):
node -v
returns v14.17.0
and npm -v
returns v7.15.0
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/v2/deb/update-nodejs-and-nodered) --node14
This is the output, followed by the log:
Running Node-RED update for user pi at /home/pi 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 ✔ v14.17.0
Install Node.js 14 LTS ✘ Bad install: Node.js missing Npm missing - Exit
Clean npm cache
Install Node-RED core
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
pi@homebridge:~ $ cat /var/log/nodered-install.log
Already have nodejs v14.17.0
OLD nodejs 14 :
NEW nodejs 14 :
***************************************
Started : Tue 1 Jun 09:55:24 BST 2021
Running for user pi at /home/pi
Found global nodes: node-red-contrib-homebridge-automation
node-red-contrib-play-audio
node-red-node-pi-gpio
node-red-node-ping
node-red-node-random
node-red-node-serialport
node-red-node-smooth :
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 4 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 'nodejs-legacy' is not installed, so not removed
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 4 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...
0 upgraded, 0 newly installed, 0 to remove and 4 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.64.0-4+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
## Installing the NodeSource Node.js 14.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://phoscon.de/apt/deconz buster InRelease
Hit:4 https://repo.mosquitto.org/debian buster InRelease
Reading package lists...
## Confirming "buster" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/buster/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
gpg: WARNING: unsafe ownership on homedir '/home/pi/.gnupg'
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x buster main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://phoscon.de/apt/deconz buster InRelease
Hit:3 http://archive.raspberrypi.org/debian buster InRelease
Hit:4 https://repo.mosquitto.org/debian buster InRelease
Get:5 https://deb.nodesource.com/node_14.x buster InRelease [4,584 B]
Get:6 https://deb.nodesource.com/node_14.x buster/main armhf Packages [774 B]
Fetched 5,358 B in 3s (2,112 B/s)
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 14.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 https://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...
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
nodejs-doc
E: Package 'nodejs' has no installation candidate
\nVersions: node:missing npm:missing\n
Then I did: sudo apt update
, which returned:
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 http://phoscon.de/apt/deconz buster InRelease
Hit:4 https://repo.mosquitto.org/debian buster InRelease
Hit:5 https://deb.nodesource.com/node_14.x buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
Then: sudo apt install nodejs
, which got:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package nodejs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
nodejs-doc
E: Package 'nodejs' has no installation candidate