YunoHost / issues

General issue tracker for the YunoHost project
71 stars 7 forks source link

Problem with nodejs helper #2364

Open tofbouf opened 3 months ago

tofbouf commented 3 months ago

Describe the bug

The nodejs helper may install the wrong version of node.

Context

To reproduce

Installing Node-Red on RPi4, with 32bit kernel ? The installation goes to end, but nodered doest not start:

Mar 17 01:13:25 natasha systemd[1]: Started Node-RED server. Mar 17 01:13:25 natasha systemd[9343]: nodered.service: Failed to execute /opt/node_n/n/versions/node/20/bin/node: No such file or directory Mar 17 01:13:25 natasha systemd[9343]: nodered.service: Failed at step EXEC spawning /opt/node_n/n/versions/node/20/bin/node: No such file or directory Mar 17 01:13:25 natasha systemd[1]: nodered.service: Main process exited, code=exited, status=203/EXEC Mar 17 01:13:25 natasha systemd[1]: nodered.service: Failed with result 'exit-code'.

The installed node is the arm64 one, which is coherent with uname -m returned value: aarch64 But, on my system, I've got: dpkg --print-architecture armhf The arm64 node is linked to a libc that is not installed on my system.

To correctly install node, I modified helpers/nodejs, function ynh_install_node() (from line 127): # Install the requested version of nodejs uname=$(dpkg --print-architecture) if [[ $uname =~ aarch64 || $uname =~ arm64 ]]; then n $nodejs_version --arch arm64 elif [[ $uname =~ armhf ]]; then n $nodejs_version --arch armv7l else n $nodejs_version fi

Note also that the --arch option was not handled correctly. It is --arch arm64, instead of --arch=arm64

Now, nodered is installed correctly and run as before the upgrade.