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

**URL:** https://forum.yunohost.org/t/best-practice-for-installing-and-using-node-in-yunohost-app-packaging/37896
**Category:** Apps packaging
**Tags:** english
**Created:** [July 28, 2025, 3:49pm UTC](https://forum.yunohost.org/t/best-practice-for-installing-and-using-node-in-yunohost-app-packaging/37896 "2025-07-28T15:49:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![notplants](https://forum.yunohost.org/user_avatar/forum.yunohost.org/notplants/32/4875_2.png) [@notplants](https://forum.yunohost.org/u/notplants)
#### Post date: [July 28, 2025, 3:49pm UTC](https://forum.yunohost.org/t/best-practice-for-installing-and-using-node-in-yunohost-app-packaging/37896/1 "2025-07-28T15:49:27Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![notplants](https://forum.yunohost.org/user_avatar/forum.yunohost.org/notplants/32/4875_2.png) [@notplants](https://forum.yunohost.org/u/notplants)
#### Post date: [July 28, 2025, 4:51pm UTC](https://forum.yunohost.org/t/best-practice-for-installing-and-using-node-in-yunohost-app-packaging/37896/2 "2025-07-28T16:51:44Z")

</div>

related, wondering after using ynh\_nodejs\_install ,  
where is the path to the associated npm for that, for example to use like this:

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

```

---

<div class="post-metadata">

### Author: ![tituspijean](https://forum.yunohost.org/user_avatar/forum.yunohost.org/tituspijean/32/3584_2.png) [@tituspijean](https://forum.yunohost.org/u/tituspijean)
#### Post date: [July 28, 2025, 8:19pm UTC](https://forum.yunohost.org/t/best-practice-for-installing-and-using-node-in-yunohost-app-packaging/37896/3 "2025-07-28T20:19:51Z")

</div>

[Node-RED](https://github.com/YunoHost-Apps/nodered_ynh/blob/master/scripts/install) could be a good reference. The NodeJS version is stored in `_common.sh` so that all scripts use it.

> [@notplants](#):
>
> `/usr/bin/npm`

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

It looks like [the helper documentation is truncated](https://doc.yunohost.org/fr/packaging/scripts/helpers_v2.1/#nodejs). It’s missing a couple interesting lines, notably for the systemd configuration: [nodered\_ynh/conf/systemd.service at master · YunoHost-Apps/nodered\_ynh · GitHub](https://github.com/YunoHost-Apps/nodered_ynh/blob/master/conf/systemd.service)

> <https://github.com/YunoHost/yunohost/blob/82e804f5c5ce185f0a750ffb2f7e93251ddc6ef4/helpers/helpers.v2.1.d/nodejs#L65-L66>
