Nodered.service does not load libraries

Dear sir, madam,

for some reason, when i start nodered through the .service file, im able to load node red with the flow but without the installed libraries.

When i load nodered through node-red commands it loads everything,

My .service file is located in /lib/systemd/system as nodered.service and it currently contains this:

# systemd service file to start Node-RED

Description=Node-RED graphical event wiring tool

# Run as normal pi user - change to the user name you wish to run Node-RED as

# uncomment and edit next line if you need an http proxy
# uncomment the next line for a more verbose log output
#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS
ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS
# Use SIGINT to stop
# Auto restart on crash
# Tag things in the log


I've tried few things such as changing the groups and workingsdirectory.

what user are you running as when you run "normal" commands ?
the service file is set to root so all the extra nodes would need to have been installed under that root user

I'm running everything as under the user "root", and to run the "normal commands" im using root too.

Is the root home directory. /home/root. Or just /root ? On my pi the root home directory is just /root...

1 Like

Obligatory note that this is generally a really bad idea. Create a new user and group to run Node-RED and set the user and group in the service file.

the directory for home is /home/root, when i use the normal command "node-red"

and this is when i start the nodered.service

i see, i will switch it over after having a good idea what causes the missing library.

It is entirely possible that the library doesn't appear because of permissions issues - caused by using root.

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