Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@PortaPi:~/.node-red $ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18
This script checks the version of node.js installed is 14 or greater. It will try to
install node 16 if none is found. It can optionally install node 12, 14, 16 or 18 LTS for you.
If necessary it will then remove the old core of Node-RED, before then installing the latest
version. You can also optionally specify the version required.
It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.
To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.
See the optional parameters by re-running this command with --help
Are you really sure you want to do this ? [y/N] ? y
Would you like to install the Pi-specific nodes ? [y/N] ? n
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 ✔ v8.17.0
Install Node.js 18 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@PortaPi:~/.node-red $
Ok, sorry to include:
This is what the files in the repository directory.
i@PortaPi:/etc/apt/sources.list.d $ cat *
deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x stretch main
deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x stretch main
#deb http://q4os.org/qextrepo q4os-rpi-firefox-cn main
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
pi@PortaPi:/etc/apt/sources.list.d $
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.21.3
Install Node.js 18 LTS ✘ Bad install: Node.js missing Npm missing - Exit
Checking log
Started : Mon 14 Aug 19:01:58 AEST 2023
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 0 not upgraded.
Installing nodejs 18
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 '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, 115 MB disk space will be freed.
(Reading database ... 125074 files and directories currently installed.)
Removing nodejs (14.21.3-1nodesource1) ...
dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not empty so not removed
Processing triggers for man-db (2.7.6.1-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.52.1-5+deb9u16).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
## Installing the NodeSource Node.js 18.x repo...
## Populating apt-get cache...
+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:3 https://deb.nodesource.com/node_14.x stretch InRelease
Reading package lists...
## Confirming "stretch" is supported...
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_18.x/dists/stretch/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 18.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x stretch main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x stretch main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...
+ apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Get:3 https://deb.nodesource.com/node_18.x stretch InRelease [4,585 B]
Get:4 https://deb.nodesource.com/node_18.x stretch/main armhf Packages [783 B]
Fetched 5,368 B in 3s (1,769 B/s)
Reading package lists...
## Run `sudo apt-get install -y nodejs` to install Node.js 18.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...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
nodejs : Depends: libc6 (>= 2.28) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
Versions: node:missing npm:missing
This is the last part - as I can make.
EDITED - the complete part now included.
pi@BeefPi:~ $ cd .node-red
pi@BeefPi:~/.node-red $ bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16
This script checks the version of node.js installed is 14 or greater. It will try to
install node 18 if none is found. It can optionally install node 16, 18 or 20 LTS for you.
If necessary it will then remove the old core of Node-RED, before then installing the latest
version. You can also optionally specify the version required.
It also tries to run 'npm rebuild' to refresh any extra nodes you have installed
that may have a native binary component. While this normally works ok, you need
to check that it succeeds for your combination of installed nodes.
To do all this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
If in doubt please backup your SD card first.
See the optional parameters by re-running this command with --help
Are you really sure you want to do this ? [y/N] ? y
Would you like to install the Pi-specific nodes ? [y/N] ?
Getting:
Running Node-RED update for user pi at /home/pi on raspbian
n
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.21.0
Install Node.js 18 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@BeefPi:~/.node-red $
Dunno why it is showing 18 though.
But as you can see I did do --node16