# Weird Httpstatic configuration in Setting.js in NR windows 11

**URL:** <https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [29 October 2022 10:12 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765 "2022-10-29T10:12:08Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 17:19 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/21 "2022-10-30T17:19:26Z")

</div>

> [@Colin](#):
>
> [http://IP:1880/schemaloex.png](http://IP:1880/schemaloex.png)

Hi Colin,  
thank you very much for your and Steve's support in this tricky situation.

No, trying to open the image from the browser with [http://IP:1880/schemaloex.png](http://IP:1880/schemaloex.png) I get this error:

```auto
Cannot GET /schemaloex.png

```

This happens both with a browser on the windows local machine where NR runs and my Mac remote machine)

BTW the browser I use is Chrome. I also tried Edge on Windows, but same result.

The only way I can get the image is bypassing node-red and getting directly from the browser with:

```auto
C:/domotica/schemaloex.png

```

Another way you can see the image inside NR is getting it with a file node, encoding it with base64 node and passing the encoded stream to the template node with this code :

```auto
<img width="100%" height="100%" alt="Image not found" src="data:image/png;base64,{{msg.payload}}" />

```

Can you confirm that with your setup node-red 3.2 would be able to get the image using localhost:1880/schemaloex.png on a windows 11 pro pc with Chrome browser?

If so I'm asking what happened to my node-red-dashboard-template installation?

What if using "Manage Palette" I delete the complete dashboard node and reinstall it? I understand that the template node alone is not manageable by the palette manager.

I'll ask Steve if he can send me a sample flow with his template node. I will import it and see if any difference

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 October 2022 17:26 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/22 "2022-10-30T17:26:57Z")

</div>

Can you show us the startup log for node-red when it is started by whatever means it is normally started?

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 17:29 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/23 "2022-10-30T17:29:55Z")

</div>

Hi Steve,  
this is the Chrome dev tool windws if I inspect the not found image:

 ![devtool](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/eff2ef4574bc53b47495f3e57d3214450e42c797.jpeg)

Apparently I have no clue why the image is not found. Frankly I do not know what to look for.

I also replied to Colin who asked me if localhost:1880/schemaloex.png would show the image, but it can't, I get the error:

Cannot GET /schemaloex

It looks like NR has permission problem with the resources on the same machine where it runs or there is some problems in the dashboard node.  
BTW can you send me your test flow with the template so I can import it and see if any difference?

I'm getting to the conclusion that I will end up reinstalling the whole Node-red!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 October 2022 17:31 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/24 "2022-10-30T17:31:50Z")

</div>

> [@Robertotarga](#):
>
> It looks like NR has permission problem with the resources on the same machine where it runs or there is some problems in the dashboard node.

Or httpstatic is not setup correctly, hence me asking to see the node red startup log when it is started by whatever means it is normally started.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 October 2022 17:31 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/25 "2022-10-30T17:31:52Z")

</div>

> [@Robertotarga](#):
>
> Apparently I have no clue why the image is not found. Frankly I do not know what to look for

Open the network tab (like I highlighted in the screen shot) & refresh the page

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 17:47 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/26 "2022-10-30T17:47:51Z")

</div>

Hi Colin,  
I enclose the startup screenshot starting NR with cmd node-red after having closed it with task manager

 ![startup](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03b020820566ab5474141a866d1a502c820ea063.jpeg)

As you can see we have a cryptic error EADDRINUSE 0.0.0.0:1880 whereas the ip of my machine is 192.168.178.59.

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 17:57 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/27 "2022-10-30T17:57:03Z")

</div>

Hi Steve,  
Sorry I missed your advice. Here is the network tab opened. Do note that all images from the complete template on the left (the one I imported from the Raspberry Pi machine) are missing as well.

 ![network refreshed](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/3438fa59b3d6c57060a67f4609cec95915c3d169.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 October 2022 18:05 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/28 "2022-10-30T18:05:31Z")

</div>

> [@Robertotarga](#):
>
> EADDRINUSE 0.0.0.0:1880

As I said previously, that means you have not stopped node red, or it has restarted itself. How is node red normally started?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 October 2022 21:52 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/29 "2022-10-30T21:52:58Z")

</div>

The point being, in case you didn't realise, that when you start node-red using the `node-red` command it uses that settings.js and http static is setup, but which settings.js is it using when it starts normally, and ends up with SYSTEM as the user?

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [30 October 2022 23:36 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/30 "2022-10-30T23:36:05Z")

</div>

Hi Colin,  
you are right, the problem is that there are 8 settings.js files in my machine after a search, but only two with size 23 kB looks good for our purposes.

 ![FoundSettings.js](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2950fcc66a3e3338ac646f532080cffd30b73e1.jpeg)

For sure initially I edited the file inside C:|Users\rober.node-red, but apparently this is not the file used by node-red when starts up. So I edited the file in C:\Users\rober\Appdata\Roaming\npm\node\_modules and restarted the machine, but still the images are not visible.

NR starts up as a service on machine restart using NSSM following the instruction of NSSM web site regarding node red.

It looks like NR uses another one settings.js since its Httpstatic is not yet set, but I can I discover it?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 October 2022 07:15 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/31 "2022-10-31T07:15:19Z")

</div>

Give us a link to how you installed it

**[Edit]** I mean how you configured it to run on boot.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 October 2022 08:26 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/32 "2022-10-31T08:26:12Z")

</div>

> [@Robertotarga](#):
>
> NR starts up as a service on machine restart using NSSM

You should probably have mentioned this much earlier.

So you likely have nssm setup with mostly default settings. And by default nssm uses the system account. When node-red runs under a different account it uses that users environment and "home" directory.

There are 2 ways to proceed...

1. Edit the nssm setup & get it to write stdout and stderr logs to files so that you can read the start up log - that will tell you everything you need to know.
2. Alternatively, you could change the "runas" settings to use your own account then it would use the settings file you have been modifying.

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [31 October 2022 12:37 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/33 "2022-10-31T12:37:12Z")

</div>

Hi Steve and Colin,  
the decision to use NSSM to start NR at startup has been the worst I could take!  
I followed the instructions found on this forum

```auto
https://discourse.nodered.org/t/run-on-windows-as-service/13569/2

```

but I was not aware that the Node-red started as a service (owned by SYSTEM) is a completely different story than starting NR from a current user with node-red command!  
For instance it has been proved that NR as a service has no way to get the local images using the template node even if you edit httpStatic parameter in

```auto
"C:\Users\rober\AppData\Roaming\npm\node_modules\node-red\settings.js"

```

Probably a more experienced user knows how to do it, but not an average end user as me. I preferred to deactivate the NSSm script and, for the time being, to start NR uniquely using its command from the terminal. At a later stage I will put it under task scheduler, but this will be trivial.

The downside of the new way of opening NR is that now I (apparently) lost my previous work, flows and added nodes! The new flow is completely empty!  
I expected to find a second flows.json in Appdata, but, no way, the file "flows.json" exists in the CurrentUser.node-red\ folder only!

The only way to recover my work has been to restart NR as a service, export all flows on a file, closing the service, opening NR as a current user and importing from file. Then patiently I had to reinstall all missing nodes!

So the support case can be closed. Now I finally see all images from template node!

Thanks again for your help and patience.  
BTW can you please suggest me which file/s should I backup to protect all my new flows and added nodes so to easily restore my NR setup in case of a disaster?

If I am allowed to give an advice I will somehow emphasize on the official docs that NR in a windows machine should be operated from the terminal with its command "node-red" and not as a service created by NSSM unless you are a windows naughty programmer and can tweak it to behave like NR opened by the current user. Hopefully this hard learnt lesson will be useful to other NR users on windows machines!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 October 2022 12:58 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/34 "2022-10-31T12:58:32Z")

</div>

> [@Robertotarga](#):
>
> If I am allowed to give an advice I will somehow emphasize on the official docs that NR in a windows machine should be operated from the terminal with its command "node-red" and not as a service created by NSSM unless you are a windows naughty programmer and can tweak it to behave like NR opened by the current user. Hopefully this hard learnt lesson will be useful to other NR users on windows machines!

I personally believe that is out of scope - NSSM is perfectly viable (in the right hands).

You issue was being unaware that NSSM chose by default to run under the `system` account. It does this for very good reason.

Like any user, the `system` account has a "home" directory.  
The reason you dont find any flow files using a regular search (from your own user account) is because the `system` users files are protected from other users (again - for good reason)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aa173a23bbf248083b1f79881e5a189eace66a2a.png)

If you want to find your old flows etc, you should have enabled the logging in NSSM...

> [@Steve-Mcl](#):
>
> Edit the nssm setup & get it to write stdout and stderr logs to files so that you can read the start up log - that will tell you everything you need to know

... then you would have seen something like ...

```auto
30 Oct 15:49:29 - [info] Flows file : C:\WINDOWS\ServiceProfiles\LocalService\blah\blah\flows.json

```

Or a quick search on the internet for [Where can I find system data stored by a Windows Service](https://www.google.com/search?q=Where+can+I+find+system+data+stored+by+a+Windows+Service) would have revealed the location `%systemroot%\ServiceProfiles`

The point is, you seem like (no offence) a "regular" user (not a power user / windows expert) and the NR docs are not really a place to teach or preach - it is not an easy balance.

**However, we would definitely consider a PR to the docs around this area.**

* * *

#### Moving forward...

My recommendation would be...

1. move your node-red userDir to `c:\something`
  - make sure the service account AND your user account have read-write access

2. set NSSM to run `node-red -p 1880 -u c:/something`
3. set the NSSM "log" tab up to output STDOUT and STDERR to write to log files in `c:/something` and enable log rotation
4. Enable NSSM

_NOTE: `c:\something` should really be something like `c:\node-red-1880` - the above was for illustration purposes_

#### Here are a few of threads that should help...

> [@Node red multiple instances](https://discourse.nodered.org/t/node-red-multiple-instances/9787/7):
>
> assuming windows (you didnt specify)... Create 4 folders... c:\node-red-1880 c:\node-red-1881 c:\node-red-1882 c:\node-red-1883 (avoid 1883) c:\node-red-1884 open 4 cmd windows Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} In cmd1... node-red -p 1880 -u c:/node-red-1880 In cmd2... node-red -p 1881 -u c:/node-red-1881 In cmd3... node-red -p 1882 -u c:/node-red-1882 In cmd4... node-red -p 1884 -u c:/no…

> [@Running Multiple Instances of Node-red using NSSM](https://discourse.nodered.org/t/running-multiple-instances-of-node-red-using-nssm/57127/2):
>
> Assuming you setup your folders like described in that thread (a few posts above the one you linked to) ([this post](https://discourse.nodered.org/t/node-red-multiple-instances/9787/7)) then you would set your NSSM commands to run each instance in the same way as if you were running it from a cmd window example... NSSM1: node-red -p 1880 -u c:/node-red-1880 NSSM2: node-red -p 1881 -u c:/node-red-1881 NSSM3: node-red -p 1882 -u c:/node-red-1882 etc etc Just be sure that the account that runs the NSSM service has read/write access to these folders.

> [@Running as a service on a windows OS](https://discourse.nodered.org/t/running-as-a-service-on-a-windows-os/37639/4):
>
> Just for completeness, NSSM can also direct stdout/stderr etc to a logfile (and do rotation) [image] [image] NOTE: I split this thread from an old (unrelated thread [Copy Node-red Install on Windows server offline](https://discourse.nodered.org/t/copy-node-red-install-on-windows-server-offline/18135/4))

---

<div class="post-metadata">

**Author:** ![Robertotarga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robertotarga/32/16890_2.png) [@Robertotarga](https://discourse.nodered.org/u/Robertotarga)\
**Post date:** [31 October 2022 15:09 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/35 "2022-10-31T15:09:49Z")

</div>

Steve,  
you are right I'm not a power user and I used NSSM without studying its intricacies, particularly it was my fault not having activated the error logs. I considered it a simple utility for an automatic NR startup, but it's not, it changes the way NR works on the user machine.

In any case it's a fact that running NR as a service in windows platform using the default NSSM installation NR has no way to use local user images thru the template node! My previous experience with NR was on a linux based Rasberry Pi4 and I didn't have so many difficulties and caveats.

In my previous post I asked which are the user critical files to backup in case of a disaster so to be able to recover all your setup simply reinstalling node-red and restoring these files.

---

<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:** [31 October 2022 18:00 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/36 "2022-10-31T18:00:17Z")

</div>

If you want a simpler way of running Node-RED robustly with the benefits of auto-restart, log management, etc, I would recommend using PM2 and starting that using Task Scheduler.

One thing to note is that if you want to run node-red before you have logged in with your user account, you will have to give scheduler your password. A better alternative is to allow PM2 to start under the SYSTEM account now that you know a bit more about how it works 🙂

Alternatively, consider setting up another local user that does not have local admin rights and run PM2/node-red under that. That could be a bit more complex if you need access to specific shared local resources but at least avoids a messed up flow (or malware compromise) messing up your main account.

PM2 does have some overheads as it is itself a node.js application. But it is quite powerful. For example, you can configure it to "watch" key files/folders and automatically restart node-red. I use this feature to make development of node-red nodes a lot nicer.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 October 2022 21:06 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/37 "2022-10-31T21:06:04Z")

</div>

Or of course you could avoid all this hassle by switching to Ubuntu and using our recommended install script which will set it all up for you.

---

<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:** [31 October 2022 21:56 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/38 "2022-10-31T21:56:08Z")

</div>

You can do that one Windows too using WSL 🙂

I even think that systemd is coming to WSL soon.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [31 October 2022 22:00 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/39 "2022-10-31T22:00:18Z")

</div>

> [@TotallyInformation](#):
>
> I even think that systemd is coming to WSL soon.

So perhaps eventually Windows will become just a wrapper round Linux 🙂

---

<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:** [31 October 2022 22:04 UTC](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765/40 "2022-10-31T22:04:05Z")

</div>

Nah, Linux will become a component of Windows 🤪

[Previous page](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765.md?page=1)

[Next page](https://discourse.nodered.org/t/weird-httpstatic-configuration-in-setting-js-in-nr-windows-11/69765.md?page=3)
