Update NodeJs and Node Red

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
FireWizard
Posts: 1968
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Update NodeJs and Node Red

Post by FireWizard »

Hi all.

I know this is a bit "off topic", as it is not a Domoticz issue, but I think I should share the experience.

I use Google Assistant integrated into Domoticz with the Nora node in Node Red and MQTT. In addition I use several other functions, which are pushed to Domoticz by MQTT.
I found some error messages from the Nora node in the debug pane of Node Red. After "googling" these messages, I found that some similar messages has got the recommendation to upgrade to the latest version of Node Red and NodeJS. (In general, it is always a good idea to upgrade in case of error messages).

So I decided to upgrade both NodeJS and Node Red. The previous version dated back to April this year (version 0.20.2 of NR)

The software is running on a Raspberry Pi 1B (so the first generation) and that uses the Arm v6 instruction set (like the Pi Zero)

The following update procedure is only applicable to the Raspberry Pi 1 (ARM v6)

To update both Node Red and NodeJS the guys from Node Red has provided an update script, called "update-nodejs-and-nodered".
This script used to function without any error.
However a newer version of the script is available and you can run it with the following command:

Code: Select all

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
The script deletes the old NodeJS version, installs NodeJS to the latest LTS version, upgrades Node Red and some other configuration things.

Currently the latest LTS version is 12.13.1 (See: https://nodejs.org/en/).
The script deletes silently your current version and tries to upgrade it to version 12.13.1.
However this version is not available for the arm v6 structure.
The log file will tell you:
Now install nodejs

install : node-v12.13.1

Error: invalid version 12.13.1

Now install Node-RED
At the end of the script, it will tell you that you start Node Red with node-red-start.
It will tell you that Node Red is not complete and it suggests you to run the script again.
The reason is that the latest LTS version 12.13.1, which the script tries to install, is not available for arm v6.
It will leave you without NodeJS.
The latest available version form arm v6 is 11.15.0 (See: https://nodejs.org/dist/)
However on the Node Red site you will find that, as this is not a LTS version, it is unsupported, but it functions.
You can also go for the previous LTS version.

To upgrade take the following steps and ignore the recommended upgrade script:

Optional: If you want to upgrade to the latest available NodeJS version, which is unsupported by Node Red, do the following steps:
Check the version you need: uname -m

1. wget https://nodejs.org/dist/latest-v11.x/no ... v6l.tar.gz
2. tar -xzf node-v11.15.0-linux-armv6l.tar.gz
3. cd node-v11.15.0-linux-armv6l
4. sudo cp -R * /usr/local/

Check If Everything Is Installed Ok

1. node -v
2. npm -v

Now you can install Node Red with npm

1. sudo npm install -g --unsafe-perm node-red

You will see that it has been installed if you see at the end something similar as:
+ [email protected]
added 332 packages from 341 contributors in 18.494s
found 0 vulnerabilities

This will update your Node Red and NodeJS to the latest available version for arm v6 (11.15.0) and Node Red to version 1.0.3.

Regards
User avatar
FireWizard
Posts: 1968
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Update NodeJs and Node Red

Post by FireWizard »

Hello All,

In the previous post (dated 17 December 2019) it is stated, that the NodeJS LTS versions 12 and higher, are not available for armv6 architecture (e.g. Raspberry Pi 1B and Raspberry Pi Zero)
Fortunately the situation has improved and the "official" install and update script points now to https://unofficial-builds.nodejs.org/download/release.
Currently the latest available release of NodeJS 12 LTS will be installed (12.22.1)

So it is safe to use the install and update script, available at: https://nodered.org/docs/getting-started/raspberrypi.

Regards
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest