Best practice for installing and using node in yunohost app packaging?

I’m looking into adding node to a yunohost package, and wondering what is the best practice for installing and using node in a yunohost app package?

Is there an example yunohost application I can look at that uses node? Does it specify a particular version of node?

related, wondering after using ynh_nodejs_install ,
where is the path to the associated npm for that, for example to use like this:

ynh_nodejs_install 18
/usr/bin/npm install -g @y/websocket-server

Node-RED could be a good reference. The NodeJS version is stored in _common.sh so that all scripts use it.

Do not do that, you would not benefit from the version-specific binary. :slight_smile:
A better example: ynh_hide_warnings ynh_exec_as_app npm install

It looks like the helper documentation is truncated. It’s missing a couple interesting lines, notably for the systemd configuration: nodered_ynh/conf/systemd.service at master · YunoHost-Apps/nodered_ynh · GitHub

1 Like