🎉 Node-RED 1.2.6 released

Node-RED 1.2.6 has been released.

This fixes an issue with the MQTT nodes when running with Node 8. However, as a gentle reminder, Node 8 is no longer maintained and doesn't receive any fixes from the Node.js project. If you're still on Node 8, we strongly urge you to update to Node 12 or 14.

As announced a couple months ago on the blog, we'll be dropping support for both Node 8 and 10 when we release Node-RED 2.0 in April next year.

For a full list of the changes (there are a couple other fixes in the release), here is the changelog:

3 Likes

Can Raspberry Pi upgrade Node.js to version 12 or higher using the installation script?

Yes it will upgrade to 12

Hi @knolleary,
I'm currently on NR 1.1.3 on Ubuntu 20.04.
How do I upgrade to 1.2.6 keeping my developed flows?

How did you install Node-RED originally?

I installed as instructed in the manual. With this script
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

I would like to continue to update using the script, but so far version Node.js remains 10th

Hi

As always I upgraded with bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Sadly, no. I upgraded to 1.2.5 as soon as that was available - no problem at all.

For reference my setup is on RPI4 (2gb) - with pretty much everything up to date - except that when I upgraded to 1.2.5, sqlite failed - that's not unusual - but I2c has not been an issue for several upgrades.

1.2.6 however, all I can say is "thank heavens for rpi-clone". The u8pgrade failed because of I2C and my blogged fix for i2c - used months ago, would not work.

For reference, at NR 1.2.5 my node.js is 10.123.0

Any thoughts on moving forward ?

If I remember well I installed it few monthes ago using the script from this page:

Should I use the same script to upgrade to latest version? As you can imagine I do not want to lose my flows during the upgrade.
TIA

Will there be a docker release as well?

yes - Due to recent changes to Travis it now takes considerably longer to generate the builds.

Which i2c nodes are you using ?

At the start of settings.js I have:

var i2c = require("i2c-bus");

and further down I have:

httpStatic: '/home/pi/.node-red/public',

functionGlobalContext: {

dateFormat:require('dateformat'),

os:require('os'),

moment:require('moment'),

fs:require('fs'),

i2c:require('i2c-bus'),

mySettings:mySettings

},

That's it. Not even using I2c on my test Pi – but it still bombed… Those settings have always been there.

Pete

And what is the actual error you are getting?

It gets worse Nick - reminiscent of early days. SO starting from my working 1.2.5 setup, I removed the two i2c lines from settings.js - and NOW I get this instead...

Here is your script running - looks successful:

Running Node-RED install for user pi at /home/pi on raspbian

This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED :heavy_check_mark:
Remove old version of Node-RED :heavy_check_mark:
Remove old version of Node.js :heavy_check_mark: v10
Update Node.js LTS :heavy_check_mark: Node v12.20.0 Npm 6.14.8
Clean npm cache :heavy_check_mark:
Install Node-RED core :heavy_check_mark: 1.2.6
Move global nodes to local -
Install extra Pi nodes :heavy_check_mark:
Npm rebuild existing nodes -
Add shortcut commands :heavy_check_mark:
Update systemd script :heavy_check_mark:

Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880

Started Thu 26 Nov 14:54:34 CET 2020 - Finished Thu 26 Nov 14:58:15 CET 2020

BUT - on node-red-start....

pi@rpi418buster:.node-red:14:58[0]> node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.18:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
26 Nov 14:58:54 - [info]
Welcome to Node-RED

26 Nov 14:58:54 - [info] Node-RED version: v1.2.6
26 Nov 14:58:54 - [info] Node.js version: v12.20.0
26 Nov 14:58:54 - [info] Linux 5.4.72-v7l+ arm LE
26 Nov 14:58:54 - [info] Loading palette nodes
26 Nov 14:58:59 - [info] Worldmap version 2.6.0
26 Nov 14:59:00 - [info] Dashboard version 2.24.0 started at /ui
It looks like serialport didn't install properly.
More information can be found here https://serialport.io/docs/guide-installation
The result of requiring the package is: undefined
Error: The module '/home/pi/.node-red/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at bindings (/home/pi/.node-red/node_modules/@serialport/bindings/node_modules/bindings/bindings.js:112:48)
at Object. (/home/pi/.node-red/node_modules/@serialport/bindings/lib/linux.js:2:36)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/pi/.node-red/node_modules/@serialport/bindings/lib/index.js:14:22)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/pi/.node-red/node_modules/serialport/lib/index.js:2:17)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/pi/.node-red/node_modules/firmata/lib/com.js:44:18)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/pi/.node-red/node_modules/firmata/lib/firmata.js:3:40)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
26 Nov 14:59:01 - [warn] ------------------------------------------------------
26 Nov 14:59:01 - [warn] [node-red-node-arduino/arduino] Missing serialport dependency
26 Nov 14:59:01 - [warn] [node-red-node-serialport/serialport] Error: The module '/home/pi/.node-red/node_modules/node-red-node-serialport/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install). (line:6)
26 Nov 14:59:01 - [warn] [node-red-node-sqlite/sqlite] Error: Cannot find module '/home/pi/.node-red/node_modules/sqlite3/lib/binding/node-v72-linux-arm/node_sqlite3.node'
Require stack:

  • /home/pi/.node-red/node_modules/sqlite3/lib/sqlite3.js
  • /home/pi/.node-red/node_modules/node-red-node-sqlite/sqlite.js
  • /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/loader.js
  • /usr/lib/node_modules/node-red/node_modules/@node-red/registry/lib/index.js
  • /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
  • /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/index.js
  • /usr/lib/node_modules/node-red/lib/red.js
  • /usr/lib/node_modules/node-red/red.js
    26 Nov 14:59:01 - [warn] ------------------------------------------------------
    26 Nov 14:59:01 - [info] Settings file : /home/pi/.node-red/settings.js
    26 Nov 14:59:01 - [info] HTTP Static : /home/pi/.node-red/public
    26 Nov 14:59:01 - [info] Context store : 'default' [module=localfilesystem]
    26 Nov 14:59:01 - [info] User directory : /home/pi/.node-red
    26 Nov 14:59:01 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
    26 Nov 14:59:01 - [info] Flows file : /home/pi/.node-red/flows.json
    26 Nov 14:59:01 - [info] Server now running at http://127.0.0.1:1880/
    26 Nov 14:59:01 - [info] Waiting for missing types to be registered:
    26 Nov 14:59:01 - [info] - sqlitedb
    26 Nov 14:59:01 - [info] - sqlite

None of this happens on recent NR upgrades including 1.2.5

So this does look like the 'usual' problem that Node.js has been updated, but the binary components of the serial module have not been rebuilt.

I know the install script is meant to rebuild the modules if it changes the node.js version, but that clearly hasn't happened here.

I would start by going to /home/pi/.node-red/ and running npm install node-red-node-serialport

See if that rebuilds the serial port module underneath node-red-node-serialport.

I'm just restoring the clone first - erm and that doesn't resolve the i2c issue....thought as to what to do with that?

Finally - note the two lines at the end about sqlitedb and sqlite ? I deliberately did not update sqlitedb and sqlite before upgrading to 1.2.5 - and so everything worked just fine - but on 1.2.6 it seems to have undertaken to trying unsuccessfully to update sqlte and sqlitedb on it's own. Cant have that as I use SQLITE... thoughts?

The upgrade script has upgraded your version of Node.js to 12.20.

This means all modules with a binary component need to be rebuilt. This will certainly include the serial port node, i2c and sqlite - we know from bitter experience they all have binary components that need rebuilding.

As I said before, the upgrade script tries to do the rebuild for you - you can see the line "Npm rebuild existing nodes" in the log output from the install script you shared.

However, for some unknown reason, it hasn't successfully rebuilt some of your modules. That is something we need to understand so the script can be improved to handle whatever scenario its missing here.

Regardless, to get you back up and running, you should manually reinstall the serial, i2c and sqlite nodes to trigger the rebuild needed.

Other people may have tried and tested ways of forcing a rebuild of these modules - they aren't ones I use, so I can only give what I think is the right way to do it.

cd .node-red
npm install node-red-node-sqlite node-red-node-serialport

Would it be a good idea to run npm rebuild to rebuild everything, in case something else has failed?

The install script does run npm rebuild - and that has not appeared to be sufficient in this case.

No harm running it manually to see if it produces a different result...