# Possible typo in latest version of /usr/lib/systemd/system/nodered.service?

**URL:** https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507
**Category:** General
**Created:** [21 July 2026 11:20 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507 "2026-07-21T11:20:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [21 July 2026 11:20 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/1 "2026-07-21T11:20:51Z")

</div>

Post withdrawn ... ... ...

---

<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: [21 July 2026 11:36 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/2 "2026-07-21T11:36:42Z")

</div>

> [@jbudd](#):
>
> This file should contain the line
> 
> ```auto
> EnvironmentFile=~/home/pi/.node-red/environment
> 
> ```
> 
> But the current version has a hyphen instead of the tilde.
> 
> ```auto
> EnvironmentFile=-/home/pi/.node-red/environment
> 
> ```

Actually, if memory serves me correctly, the version with the leading dash is, in fact, the correct version. I believe it tells systemd to ignore a missing file. Since most people won't have that file in that location, Node-RED would otherwise fail to start. Also, you couldn't have a leading tilde there anyway since systemd reads that at system startup when there is no user, the tilde represents the current user's home folder. That is why the file path starts with a `/` - e.g. the root of the Linux filing system.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [21 July 2026 11:46 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/3 "2026-07-21T11:46:26Z")

</div>

Well I only noticed it because variables defined in the file were not available in Node-red, so it's not working.

It is not clear to me what you mean by referring to the filesystem root.  
I do understand absolute and relative paths, hopefully! 😃

---

<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: [21 July 2026 11:47 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/4 "2026-07-21T11:47:02Z")

</div>

> [@jbudd](#):
>
> 1. If the tilde is restored, should these variable definitions be moved from the systemd script to the environment file?

I don't _think_ so because aren't those required by the systemd script? Node-RED itself certainly does not need them. Also, I doubt the `max_old_space` is helpful on 99% of installs now anyway. In my view it should not be used unless you actually have a memory issue. This dates from much older versions of node.js.

> [@jbudd](#):
>
> 1. The systemd script sets WorkingDirectory=/home/pi, presumably to facilitate multiple installations on the same Pi.  
> Should the environment file line use this rather than having `/home/pi/.node-red/environment`?

Has this changed from previous versions? Remember that this is the working directory for the systemd script. I'm not actually sure if it does anything useful here.

> [@jbudd](#):
>
> 1. A couple of years ago [I suggested](https://discourse.nodered.org/t/report-import-of-environmentfile-in-node-red-console-log/89673) that the environment file used to initialise NR variables should be included in the log output:

The problem is that Node-RED cannot know of that file's existence unless is manually checks for it. The file is used by systemd, not directly by node.js/node-red. Though obviously the resulting environment variables are then available in Node-RED.

So actually, logging its presence might be as confusing as it is helpful.

Also worth noting that, from node.js v20, it supports .env files natively. Previously, you needed the `dotenv` package but that isn't needed any more.

---

<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: [21 July 2026 11:51 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/5 "2026-07-21T11:51:45Z")

</div>

> [@jbudd](#):
>
> Well I only noticed it because variables defined in the file were not available in Node-red, so it's not working.

Do you definitely have the file `/home/pi/.node-red/environment`? And you reloaded the systemd definition and restarted it? (or rebooted).

> [@jbudd](#):
>
> It is not clear to me what you mean by referring to the filesystem root.  
> I do understand absolute and relative paths, hopefully!

When we talk about "absolute" paths, they, by definition, start from the filesystem root folder, `/` in Linux. Windows can have multiple root paths, typically things like `C:/`, etc. Whereas UNIX-like OS's have a unified file system.

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [21 July 2026 12:19 UTC](https://discourse.nodered.org/t/possible-typo-in-latest-version-of-usr-lib-systemd-system-nodered-service/101507/6 "2026-07-21T12:19:51Z")

</div>

> [@TotallyInformation](#):
>
> Do you definitely have the file `/home/pi/.node-red/environment`? And you reloaded the systemd definition and restarted it? (or rebooted).

As I recall, I burned a fresh OS, installed NR4, edited .node-red/environment and added variables, it worked (the systemd script has a tilde).  
Then I burned a fresh OS, installed NR5, edited .node-red/environment and added variables, it didn't work (the systemd script has a hyphen).

But I might have made a mistake, I often do.  
I do have a vague memory of talking about hyphens and tildes in the past, maybe here, maybe not.

Thanks for all the hints and corrections.  
For fear of getting into an argument I'll let it rest.
