Global installed nodes ar not available in palette

Hi, I have installed Node Red in a Beaglebone Black with debian Buster via apt:
apt install nodejs npm bb-node-red-installer
Everything is working as expected. The problem comes when I add some nodes via global npm install, I restart Node Red but the nodes are not available in the palette.
If I look for modules installed I find that Node Red preinstalled nodes are in /opt/node-red/lib/node_modules and global installed module are in /usr/local/lib/node_modules
I have installed nodes via global npm install in other systems with no problem. Any advice on how to install the nodes via npm install?

You don't need to globally install them.

Either install them using the Palette Manager in the editor, or run the npm install command in ~/.node-red.

Thanks for your fast response. I had already tested the Palette Manager install and it was working ok.
To put all in context, I am trying to deploy Node Red with Ansible, I first apt install bb-node-red-installer and then the nodes with npm global install. All was working fine, but I updated to buster 10.2, I was previously using 10.1 image (rcn-ee.com images), and I have found that the systemd service start script changed in the image update, and perhaps that is the problem.
Before:

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=debian
Group=debian
WorkingDirectory=/home/debian

Environment="NODE_PATH=/usr/local/lib/node_modules"
Environment="NODE_OPTIONS=--max_old_space_size=256"

ExecStart=/usr/bin/env /usr/bin/nodejs $NODE_OPTIONS /usr/local/bin/node-red $NODE_RED_OPTIONS

After image update:

[Service]
Type=simple
# Run as normal pi user - change to the user name you wish to run Node-RED as
User=node-red
Group=node-red
WorkingDirectory=/var/lib/node-red

Environment="NODE_PATH=/opt/node-red/lib/node_modules"
Environment="NODE_OPTIONS=--max_old_space_size=256"
Environment="HOME=/var/lib/node-red"

WorkingDirectory=/var/lib/node-red
ExecStart=/usr/bin/env /opt/node-red/bin/node $NODE_OPTIONS /opt/node-red/lib/node_modules/node-red/red.js $NODE_RED_OPTIONS

I will continue looking for a solution.

Well, given that you are not using a Pi, I should think that might be a clue. The service file is set up to work on a Pi without changes but if you run on a different platform, as it says, you need to adjust the configuration.

I realized that the package bb-node-red-installer installs Node Red and its dependencies under /opt/node-red, with its own NODE_PATH. If you want to install a node from terminal you have to do it in the systemd service configured User Directory for Node Red (/var/lib/node-red/.node-red), not globally. As @knolleary pointed in the first answer.
Another important thing is that there is a node-red user executing Node Red, but this user has no permissions over beaglebone io, i2c.... Doing sudo usermod -a -G dialout,i2c,iio,spi,pwm,gpio node-red solves the problem.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.