Open mvanbrab opened 1 month ago
Hmm the error indicates a network issue, but a connection check is fine before the install. Maybe npmjs servers have an issue 🤔. I'lly to replicate.
Hi @MichaIng ,
I tried one more time from a fresh image today and I could at least finalize the installation of Node-RED this time, so there may have been some intermittent connectivity issue during all my previous trials, or some changes may have happened in the online resources meanwhile.
However, the installation result was not as expected: the service fails to start.
I tried to diagnose:
root@dietpi1:~# systemctl status node-red
× node-red.service - Node-RED (DietPi)
Loaded: loaded (/etc/systemd/system/node-red.service; enabled; preset: enabled)
Active: failed (Result: signal) since Wed 2024-11-06 18:00:44 CET; 2min 34s ago
Duration: 5.203s
Process: 3629 ExecStart=/mnt/dietpi_userdata/node-red/node_modules/.bin/node-red -u /mnt/dietpi_userdata/node-red (code=killed, signal=ILL)
Main PID: 3629 (code=killed, signal=ILL)
CPU: 4.466s
Nov 06 18:00:39 dietpi1 systemd[1]: Started node-red.service - Node-RED (DietPi).
Nov 06 18:00:44 dietpi1 systemd[1]: node-red.service: Main process exited, code=killed, status=4/ILL
Nov 06 18:00:44 dietpi1 systemd[1]: node-red.service: Failed with result 'signal'.
Nov 06 18:00:44 dietpi1 systemd[1]: node-red.service: Consumed 4.466s CPU time.
root@dietpi1:~#
I tried to further investigate by executing the ExecStart command found in /etc/systemd/system/node-red.service
. It resulted in a single line error message:
root@dietpi1:~#/mnt/dietpi_userdata/node-red/node_modules/.bin/node-red -u /mnt/dietpi_userdata/node-red
Illegal instruction
For what it's worth, I found a post on the Node-RED forum, describing exactly the same behaviour, also on a RPi Zero W, but outside DietPi.
Maybe that solution needs to be integrated in DietPi?
Our Node.js installer https://github.com/MichaIng/nodejs-linux-installer installs the unofficial Node.js builds on ARMv6 already. Problem is the bcrypt module, it seems.
I'll run some tests on my Zero W.
Node-RED v4 adds a new dependency @node-rs/bcrypt
, which does not support ARMv6:
We hence need to install Node-RED v3 on ARMv6: https://github.com/MichaIng/DietPi/commit/2187d65
To do that manually:
systemctl stop node-red
cd /mnt/dietpi_userdata/node-red
sudo -u nodered npm i --no-audit node-red@3
systemctl start node-red
The manual workaround works perfectly on my RPi Zero W! Thank you very much @MichaIng !
Creating a bug report/issue
Required Information
cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=9 G_DIETPI_VERSION_SUB=8 G_DIETPI_VERSION_RC=0 G_GITBRANCH='master' G_GITOWNER='MichaIng'echo $G_DISTRO_NAME $G_RASPBIAN
bookworm 1uname -a
Linux dietpi16.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux
echo $G_HW_MODEL_NAME
or (EG: RPi3) RPi Zero W (armv6l)Additional Information (if applicable)
echo $G_HW_UUID
693b1d7d-ae95-4e05-b5cc-5966cbd2efb2Steps to reproduce
Expected behaviour
Actual behaviour
Extra details