# Nodered.service does not load libraries

**URL:** <https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286>\
**Category:** General\
**Created:** [14 April 2022 12:09 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286 "2022-04-14T12:09:55Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![endkinghenry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/endkinghenry/32/58122_2.png) [@endkinghenry](https://discourse.nodered.org/u/endkinghenry)\
**Post date:** [14 April 2022 12:09 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/1 "2022-04-14T12:09:55Z")

</div>

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:

```auto
# systemd service file to start Node-RED

[Unit]
Description=Node-RED graphical event wiring tool
Wants=network.target
Documentation=http://nodered.org/docs/hardware/raspberrypi.html

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

Nice=5
Environment="NODE_OPTIONS=--max_old_space_size=256"
# uncomment and edit next line if you need an http proxy
#Environment="HTTP_PROXY=my.httpproxy.server.address"
# uncomment the next line for a more verbose log output
#Environment="NODE_RED_OPTIONS=-v"
#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
KillSignal=SIGINT
# Auto restart on crash
Restart=on-failure
# Tag things in the log
SyslogIdentifier=Node-RED
#StandardOutput=syslog

[Install]
WantedBy=multi-user.target

```

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 April 2022 13:37 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/2 "2022-04-14T13:37:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![endkinghenry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/endkinghenry/32/58122_2.png) [@endkinghenry](https://discourse.nodered.org/u/endkinghenry)\
**Post date:** [14 April 2022 14:10 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/3 "2022-04-14T14:10:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [14 April 2022 17:01 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/4 "2022-04-14T17:01:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 April 2022 19:10 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/5 "2022-04-14T19:10:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![endkinghenry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/endkinghenry/32/58122_2.png) [@endkinghenry](https://discourse.nodered.org/u/endkinghenry)\
**Post date:** [15 April 2022 06:05 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/6 "2022-04-15T06:05:59Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/7/6747b9ced1ee47d42fcb41c03ff9419ae263a543.jpeg)

and this is when i start the nodered.service

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/0/4049cb5c9f37f39ffa95c1389a6eab4d7ce66d36.png)

---

<div class="post-metadata">

**Author:** ![endkinghenry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/endkinghenry/32/58122_2.png) [@endkinghenry](https://discourse.nodered.org/u/endkinghenry)\
**Post date:** [15 April 2022 06:11 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/7 "2022-04-15T06:11:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 April 2022 10:18 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/8 "2022-04-15T10:18:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 June 2022 10:19 UTC](https://discourse.nodered.org/t/nodered-service-does-not-load-libraries/61286/9 "2022-06-14T10:19:07Z")

</div>

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