Hi
I'm trying to run node-red on a headless pi zero w with a fresh OS install. This all worked previously with an earlier pi OS and version 3.x of node-red - until my ssd died. I've tried to reinstall and get it working but with little success.
I'm aware that due to the arm6 hardware of the pi zero, I have to use unofficial node builds as described here:
https://github.com/sdesalas/node-pi-zero
I copied a script and changed the version to 20.15.0 - which I thought was the latest version - and node seems to have installed correctly.
Running "node -v" I get:
v20.15.0
My OS version is:
Operating System: Raspbian GNU/Linux 12 (bookworm)
Kernel: Linux 6.6.31+rpt-rpi-v6
Architecture: arm
I installed nodered using:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
Y to continue
N for additional pi nodes
Trying to start the service (node-red-start) it couldn't find the start / stop scripts so I added the following to .bashrc:
PATH=/opt/nodejs/bin/:${PATH}
I could then run the start script but it failed with an error:
/usr/bin/env: 'node-red-pi': No such file or directory
I added the following symlink as described here:
https://github.com/HaroldPetersInskipp/Raspberry-Pi-Scripts
sudo ln -s /opt/nodejs/lib/node_modules/node-red/bin/node-red-pi /usr/bin/node-red-pi
Now, running node-red-start, it fails with the following:
Starting as a systemd service.
nodered.service: Main process exited, code=killed, status=4/ILL
nodered.service: Failed with result 'signal'.
nodered.service: Consumed 4.746s CPU time.
nodered.service: Scheduled restart job, restart counter is at 1.
Stopped nodered.service - Node-RED graphical event wiring tool.
nodered.service: Consumed 4.746s CPU time.
Started nodered.service - Node-RED graphical event wiring tool.
nodered.service: Main process exited, code=killed, status=4/ILL
nodered.service: Failed with result 'signal'.
nodered.service: Consumed 4.783s CPU time.
nodered.service: Scheduled restart job, restart counter is at 2.
Stopped nodered.service - Node-RED graphical event wiring tool.
nodered.service: Consumed 4.783s CPU time.
...
If I edit the script "/opt/nodejs/lib/node_modules/node-red/bin/node-red-pi", and put some debug in to dump $OPTIONS, $ARGS and $0, and then run it using:
node-red-pi --max-old-space-size=128 -v
I get the following:
OPTIONS: --max-old-space-size=128
ARGS: -v
0: /usr/bin/node-red-pi
< ... a delay of about 5 seconds ... >
Illegal instruction
The script is obviously being called with my args, but it is then exiting with "Illegal instruction" after a delay of about 5 seconds.
If I rerun the installer, the log contains the line "Package 'nodered' is not installed, so not removed" - which seems a little strange as I had previously run the node-red installer as above.
I also notice in the forum there is what seems to be a similar post: 🎉 Node-RED 4.0 released - #20 by FireWizard52
I suspect that my installation of node-red didn't complete correctly and I'm still missing some symlinks, environment config or permissions.
I'm struggling to move forward with this and any help would be very much appreciated.
Thanks
Dave