After issues with the SD cards on the running Raspis I decided to change the SD-cards and put the newest Raspian on the Raspis.
This worked for two Raspi 2, but failed repeatedly for a Raspi 3 Model B Vi.2.
The bash command stops at "Install Node.js for Armv6" and claims invalid version for Node.js and npm. I tried several ways to fix it, but was not successful. The bash command always failed, with then different messages.
As I repeated the procedure 3 times with different SD-cards I assume a systematic issue.
Also check that this command runs successfully sudo apt update && sudo apt full-upgrade
If that does anything then run the script again. If it still fails post the install log here, /var/log/nodered-install.log
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
In the script there is mentioned :
"node.js ... It can optionally install node 12, 14, 16 or 18 LTS for you."
The script did install node 12 and then stated, node 12 is not good for Node-RED. I assume, the script did not find the hardware of my Pi 3 and then defaulted to node 12. Default to node 16 would not cause trouble, ;-).
The installation of node 12 should be removed from the script. The default for not identified HW should be increased to node 16. In another part of the script you find
"You can force an install of node 14, 16 or 18 by using ..."
Version 14 would have been o.k. , but not optimum.
Maybe it is also a good idea to log the options, which were used when calling the script. Easiest would be to log the complete command line.
Actually you already had nodejs 12.22 installed. The script (on this run at least) did not install node.js
It should have given quite a helpful message, though you didn't post that bit.
"Nodejs 12 too old and new version not specified - exiting"
"Node-RED v3.x no longer supports Nodejs 12 "
" You can force an install of node 14, 16 or 18 by using the --node14, --node16 or --node18 parameter."
" However doing so may break some nodes that may need re-installing manually."
" Generally it is recommended to update all nodes to their latest versions before upgrading."
It would be interesting to know how 12.22 came to be installed. Did you install Raspbian Lite, Desktop or Desktop with Recommended Software?
I use a different installer, which does not offer these choices. In the past I always used "simple" desktop, without recommended software. Installing the recommended software caused much pain.
I use the Raspberry Pi Imager v1.7.5 on a Mac
I chose Raspberry Pi OS (32-bit)
A port of Debian Bullseye with Raspberry Pi Desktop (Recommended)
Published : 2023-05-03
As I made several tries I don't remember everything I did. I can not exclude that, in my desperation, tried to install nodejs in one or the other case. I definitely also removed nodejs manually. Anyhow : the script should detect the old nodejs version and offer a fix, rather than to simpy "exit". On request the script could remove the old nodejs version and install the most recent stable version.
I don't think it is of any use to repeat the exercise on a virgin SD-card to get the full log for rpi3.
I very much doubt if it shows Exactly what is in the log.
For example, the screen display should end with "Exiting now" while the log contains "exiting".
Accuracy is important when reporting software glitches.
FWIW there is code in the script which, if node.js V12 is found, prints another message if the minor version is <= 17.
It would probably be a good idea to remove this code.
Does anyone know whether RPiOS with recommended software still installs node.js 12.22?
Was there a pressing reason to make the choice of node version non-interactive? - a conflict with other software maybe?
Thanks to all.
Next time I have this kind of trouble I will take a screenshot with the error message and provide the full log. This should help to better understand what happened. The script definitely installed a version 12 nodejs installation and then complained about the old version.
The script definitely installed a version 12 nodejs installation
If it did that it would be in the install log.
I note that the bullseye raspbian repository has nodejs 12.22.12. That means that either nodejs was installed by default, or somehow the command sudo apt install nodejs
was run before the node-red script was run.
The fact that the script ran ok on two of your pis means that there was something different about the system on third one before the script was run.