Dashboard on RPi Zero W

7 Jan 13:55:38 - [info] Node-RED version: v2.1.4
7 Jan 13:55:38 - [info] Node.js version: v12.22.8
7 Jan 13:55:38 - [info] Linux 5.10.52+ arm LE

I wanted to check on setting up Node-Red Dashboard on a RPi Zero W. The official install configured Node.js 10.24.0. But the Dashboard said it requires node.js 12 or higher. Surprisingly, the nodes I was using from the dashboard seemed to work (ui_chart and ui_gauge). But I thought perhaps all was not as it should be and tried to install Node.js 12.

So I downloaded what appeared to be the last Node.js 12.x tarball for linux-armv6l from the "experimental" Node.js web site, extracted the files, and copied to /usr/local. This was a recommended procedure I found online to update the version of Node.js on a Raspberry Pi. While node and npm reported the new versions, I got a segmentation fault trying to run node-red. Attempting to run npm rebuild or npm install didn't help. Researching what might cause a segmentaion fault in node I ran across a suggestion to run the following commands:
sudo apt --auto-remove purge npm
sudo apt --auto-remove purge nodejs

It was worth a try. This appeared to work. Node-RED now starts and runs without any problem as above and the Dashboard seems happy for now.

I have a lot of experience doing C programming on MCUs but I am new to Node-RED and a newbie in JavaScript. Honestly I don't know what I'm doing here though and I thought someone on the forum might offer an explanation and critique. While it seems to have worked for me by trial and error, is the above method OK? And if you could take the time to offer an explanation as to what it did I'd be interested to hear it.

Thanks, Max

How did you install node-red to start with?

The Node-RED installer script should have installed NodeJS 12 even on a Pi Zero W.

Huh! I just ran the installer script without the NodeJS 12 option. I didn't think that would work on the RPi Zero W due to the 12.x versions not being an "official" release for the Arm6.

I'll give that a try and report if it works.

Thanks for the reply,
Max

you would be better going to --node14 as the unofficial version of that is more maintained - and yes the script does use the unofficial versions for arm6 as there are no official ones.

Yes! The script worked fine.
And I followed your advice to move to node 14.

7 Jan 18:07:52 - [info]

Welcome to Node-RED

7 Jan 18:07:53 - [info] Node-RED version: v2.1.4
7 Jan 18:07:53 - [info] Node.js version: v14.18.1
7 Jan 18:07:53 - [info] Linux 5.10.52+ arm LE
7 Jan 18:07:57 - [info] Loading palette nodes
7 Jan 18:08:11 - [info] Dashboard version 3.1.3 started at /ui

Thanks! Good to go!
Max

1 Like

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