Install Node-RED with NodeJS v12 (instead of NodeJS v14)?

I am running the NR v2.2 and installed these nodes via the manage pallete, and now NR won't start. I did some research and found that according to their instructions, their nodes want NodeJS v12 (not v14).

Question: If I wipe my Pi and start fresh, can I install NodeRED v2.2 but specify / install NodeJS v12? I seem to recall seeing this done, but not using the script. Sorry if this has been covered before, but I could not find a recent how-to on this subject.

Yes, you can use nodejs 12 (which BTW is end of life in 8 days)
you simply append --node12 to the end of the official installer script.

The better solution is for them to update there nodes.

In fact, there is an open PR for 2021 where a contributor has shown that even Nodejs 16 can be used...

1 Like

If you add --node12 to the end of the install script line it will force node12 install... (or --help to see all the options) ie

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

and if you wanted to test that PR works, you could install the fork directly from github by entering

cd ~/.node-red
npm i MaddyTP/node-red-contrib-widgetlords

(assuming node-red is running from ~/.node-red - adjust as necessary.

Thank you both. I started clean and installed Node-RED from the script and then followed Steve's instructions to install the fork directly. Unfortunately, this is what I got at the end...

make: Leaving directory '/home/pi/.node-red/node_modules/ffi-napi/build'
npm WARN node-red-contrib-ui-led@0.4.9 requires a peer of node-red-dashboard@^2.23.3 but none is installed. You must install peer dependencies yourself.

+ node-red-contrib-widgetlords@1.3.0
added 9 packages from 85 contributors and audited 108 packages in 37.799s

12 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

I then ran npm audit fix and got this:

npm WARN node-red-contrib-ui-led@0.4.9 requires a peer of node-red-dashboard@^2.23.3 but none is installed. You must install peer dependencies yourself.

updated 2 packages in 2.962s

12 packages are looking for funding
  run `npm fund` for details

fixed 1 of 1 vulnerability in 108 scanned packages

Then, running node-red-start, it seems to launch fine, but once I am at localhost:1880, I do not see the nodes from Widgetlords installed (should I, or do I need to install them via the palette manager?).

Here is what I see in terminal:

Starting as a systemd service.
22 Apr 07:33:31 - [info] Stopping flows
22 Apr 07:33:31 - [info] Stopped flows
22 Apr 07:33:31 - [info] Starting flows
22 Apr 07:33:31 - [error] [ui_countdown_timer_switch:b33c17e29f7e5573] ui_countdown_timer_switch.error.no-group
TypeError: Cannot read property 'config' of null
    at new LEDNodeConstructor (/home/pi/.node-red/node_modules/node-red-contrib-ui-led/dist/nodes/ui_led/ui_led.js:25:44)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:90:27)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:206:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:371:33)
22 Apr 07:33:31 - [error] [ui_multistate_switch:da23122264b3d9e5] No group has been specified
22 Apr 07:33:31 - [info] Started flows
22 Apr 07:33:48 - [info] Stopping flows
22 Apr 07:33:48 - [info] Stopped flows
22 Apr 07:33:48 - [info] Starting flows
22 Apr 07:33:48 - [error] [ui_countdown_timer_switch:b33c17e29f7e5573] ui_countdown_timer_switch.error.no-group
TypeError: Cannot read property 'config' of null
    at new LEDNodeConstructor (/home/pi/.node-red/node_modules/node-red-contrib-ui-led/dist/nodes/ui_led/ui_led.js:25:44)
    at Object.createNode (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/util.js:90:27)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:206:48)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/index.js:371:33)
22 Apr 07:33:48 - [error] [ui_multistate_switch:da23122264b3d9e5] No group has been specified

I can abort this route and go back and instead just install NodeJS 12 via the script and then install the nodes via the pallette manager.

PS: Looking back over the messages above, it would appear none of the errors have to do with the Widgetlords nodes, do they?

Nope.

And looking at your install of "MaddyTP/node-red-contrib-widgetlords" it appears to have worked...

+ node-red-contrib-widgetlords@1.3.0
added 9 packages from 85 contributors and audited 108 packages in 37.799s

At localhost:1880, I do not see the nodes from Widgetlords installed. Do I need to install them via the palette manager? I was under the impression that installing the fork would make them appear in the list of installed nodes.

EDIT: It appears they are installed, but nothing on the left pane:

Have you refreshed the browser?

Yes, and they are still not appearing in the left pane.

I just stopped Node-RED and then restarted, and now it seems errors with these nodes are preventing NR from properly starting:

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.8.193: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.
22 Apr 09:23:32 - [info]
Welcome to Node-RED
===================
22 Apr 09:23:32 - [info] Node-RED version: v2.2.2
22 Apr 09:23:32 - [info] Node.js  version: v14.17.5
22 Apr 09:23:32 - [info] Linux 5.10.52-v7l+ arm LE
22 Apr 09:23:33 - [info] Loading palette nodes
#
# Fatal error in , line 0
# Check failed: result.second.
#
#FailureMessage Object: 0xbecdd648
nodered.service: Main process exited, code=killed, status=4/ILL
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=20s expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 1.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
22 Apr 09:23:57 - [info]
Welcome to Node-RED
===================
22 Apr 09:23:57 - [info] Node-RED version: v2.2.2
22 Apr 09:23:57 - [info] Node.js  version: v14.17.5
22 Apr 09:23:57 - [info] Linux 5.10.52-v7l+ arm LE
22 Apr 09:23:58 - [info] Loading palette nodes
22 Apr 09:24:01 - [info] Dashboard version 3.0.4 started at /ui
22 Apr 09:24:01 - [warn] ------------------------------------------------------
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-digital] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-relay] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-analog-in] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-analog-out] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-8ai-16b] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-analog-in] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-analog-out] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-digital] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-pi-spi-din-4freq] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-relay] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-3011b-digital] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-3011b-relay] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-3011b-sdafe] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:12)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-2901a-digital] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-2901a-relay] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-2901a-sdafe] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:12)
22 Apr 09:24:01 - [warn] [node-red-contrib-widgetlords/widgetlords-vpe-2901a-analog-out] Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 09:24:01 - [warn] ------------------------------------------------------
22 Apr 09:24:01 - [info] Settings file  : /home/pi/.node-red/settings.js
22 Apr 09:24:01 - [info] Context store  : 'default' [module=memory]
22 Apr 09:24:01 - [info] User directory : /home/pi/.node-red
22 Apr 09:24:01 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 Apr 09:24:01 - [info] Flows file     : /home/pi/.node-red/flows.json
22 Apr 09:24:01 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
22 Apr 09:24:01 - [info] Server now running at http://127.0.0.1:1880/

And once I get into the browser and look at the installed nodes, I see this:

OK, so removing the above nodes and then installing NodeJS v12 via the script, then adding these nodes via palette manager, I get this in the terminal window:

Starting as a systemd service.
22 Apr 10:21:29 - [info]
Welcome to Node-RED
===================
22 Apr 10:21:29 - [info] Node-RED version: v2.2.2
22 Apr 10:21:29 - [info] Node.js  version: v12.22.12
22 Apr 10:21:29 - [info] Linux 5.10.52-v7l+ arm LE
22 Apr 10:21:30 - [info] Loading palette nodes
22 Apr 10:21:31 - [info] Dashboard version 3.1.6 started at /ui
22 Apr 10:21:32 - [info] Settings file  : /home/pi/.node-red/settings.js
22 Apr 10:21:32 - [info] Context store  : 'default' [module=memory]
22 Apr 10:21:32 - [info] User directory : /home/pi/.node-red
22 Apr 10:21:32 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 Apr 10:21:32 - [info] Flows file     : /home/pi/.node-red/flows.json
22 Apr 10:21:32 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
22 Apr 10:21:32 - [info] Server now running at http://127.0.0.1:1880/
22 Apr 10:21:32 - [info] Starting flows
22 Apr 10:21:32 - [info] Started flows
22 Apr 10:22:12 - [info] Installing module: node-red-contrib-widgetlords, version: 1.3.0
22 Apr 10:23:07 - [info] Installed module: node-red-contrib-widgetlords
22 Apr 10:23:08 - [info] Added node types:
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-digital : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-relay : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-analog-in : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-analog-out : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-8ai-16b : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-analog-in : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-analog-out : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-digital : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-pi-spi-din-4freq : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-relay : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-3011b-digital : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-3011b-relay : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-3011b-sdafe : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:12)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-2901a-digital : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-2901a-relay : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-2901a-sdafe : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:12)
22 Apr 10:23:08 - [info]  - node-red-contrib-widgetlords:widgetlords-vpe-2901a-analog-out : Error: ENOENT: no such file or directory, open 'libwidgetlords.so' (line:3)

and this in the palette manager:

FWIW, I have emailed them and asked for an update on when they will fix this.

So does that missing file need to be pre-installed via some setup ?ie do they expect you to have installed some other Linux or python package first ? Maybe check their readme

@dceejay and @Steve-Mcl Thank you both! I put the cart before the horse and did not follow their instructions to install the library. Once I did that, I was able to get everything running using the fork from Github, and I'm running NodeJS v16, so I am all set.

2 Likes

I have added a comment to the repository indicating your success - hopefully they will upgrade

2 Likes

And we have success. New version now in flows library...

1 Like

That's great. I am testing these now (using their hardware).

1 Like

Just in case anyone is interested in how this turned out...Remember this analog output interface board has two (2) 4-20 mA outputs and two (2) 0-10 VDC outputs. From their website:

The DAC uses a 12 bit converter with a 3.3V Reference. The output circuit has been optimized to provide 4 mA at 745 D/A counts and 20 mA at 3723 D/A counts. (For the VDC outputs the circuit has been optimized for 2 and 10 VDC output). Please note the values are approximate and may vary from module to module and from channel to channel.

In my case...

  • injecting 1820 into the node results in ~5VDC (as measured with a multimeter)
  • injecting 3000 into the node results in ~8.26VDC (as measured with a multimeter)
  • injecting 3640 into the node results in ~10VDC (as measured with a multimeter)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.