Problem with "get started" bash command on "fresh" Raspian on Raspi3, while two Raspi2 work

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.

What operating system do you have on the Pis?

Can you try specifying node.js v16 by running these commands?
Post the output here.

cd 
pwd
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node16

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

Thanks !

operating system
$cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"

@jbudd : your proposal of the bash command with "--node16" worked perfectly !

@Colin : Everything was up to date, nothing was updated

Now also the Raspi 3 Model B works again. I wonder, what goes wrong in the proposed bash command ?

Thanks again !

If you post the failing install log then it may become clearer.

@Colin

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.

The key thing is exactly what that error message said. Ideally it should tell you to run the command with the parameter to install a valid version.

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?

@jbudd , @Colin

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.

It should tell you that you have an old version of nodejs and tell you how to fix it, as mentioned by @jbudd.

"It should tell you that you have an old version of nodejs and tell you how to fix it, as mentioned by @jbudd."

And exactly this part of the script does not work on my rpi3

Is that the full log? If not then please post the full log.

@Colin that's exactly what the script would log if it finds v12.22.
The long warning message with suggested fix is printed on the screen but not logged.

Of course you may be looking for something else earlier in the log. :grin:

Ok, thanks for that.
So @Ekki_b, we don't need the log, the question is, what do you see on screen when you run the script?

Exactly what is shown in the log : " ... wrong version of nodejs, exit "

As you know, the installation logs are not shown.

I did not bother so far to check the options of the script. That might have given me a hint.

So ... something goes wrong. But there are nice people, who helped me out before i was forced to check the options :slight_smile:

Can you run the script again please and show us a screenshot of the output, we need to understand why the script is not doing what it should.

1 Like

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?

Main reason was so the script itself could be called by another script if required, so it could run without requiring user input.

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.

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.