Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with nodejs helper #2364

Open
tofbouf opened this issue Mar 17, 2024 · 0 comments
Open

Problem with nodejs helper #2364

tofbouf opened this issue Mar 17, 2024 · 0 comments
Labels
🤓 helpers 👾 bug Something isn't working

Comments

@tofbouf
Copy link

tofbouf commented Mar 17, 2024

Describe the bug

The nodejs helper may install the wrong version of node.

Context

  • Hardware: Raspberry Pi4 at home
  • YunoHost version: 11.2.10.3
  • I have access to my server: Through SSH | through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: maybe...
    • See below:

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.

@tofbouf tofbouf added the 👾 bug Something isn't working label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤓 helpers 👾 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants