Running Node Red in Windows

#1

Hello guys

I'm running the red node with windows and would like to know how to automatically start it.

With the task manager it did not work well.

I configured using NSSM and until it starts but when I changed, for example, the port it did not load.

Anyone have any idea what might be happening?

#2

What version of windows, what version of NR

Can you show us a screen shot of the startup and also the NSSM config ?

Craig

#3

Are you saying that you made a change to the settings.js file, and the service did not restart? If so, then that is to be expected. There is no "watchdog" built-in to node-red... you would have to either create a flow that watches the userdir, or run it under nodemon -- or just do a manual restart.

#4

I am using Windows Server 2008.

image

#5

No!

I actually restart the service manually. What I'm saying is that the settings made are not respected.

Like, I changed the door from 1880 to 8888 and it did not work.

#6

Didn't we cover this a few days ago. I gave the information on how to start node-red using the Windows Scheduler. NSSM can be used but isn't necessary. The Scheduler will try to restart a failing task but you may find something like PM2 to be more reliable and controllable (at the cost of significant additional resource use).

#7

Ok, well that sounds like you are changing the wrong settings.js file then... check the path that is output in the node-red log file at startup.

1 Like
#8

which settings file did you edit... - when we start the first time the default one gets copied to the users directory. If you edited the "old" default one - then it won't affect the user one that is being used..

#9

I am ediing settings.js file in:
C:\Users\xxxxx\AppData\Roaming\npm\node_modules\node-red

but, I believe it is:
C:\Users\xxxxx.node-red

#10

Did not work.

It looks like when I register a service it gets to the initial settings.

I was running the file node-red.cmd and when the settings changes it works normal.

When I close the node-red.cmd the red node to, right. When it starts the service it comes with the default start port.

#11

Actually the default userdir should be in C:\Users\xxxxx\.node-red

If you can show us the console logs created when the service starts, that would make it clear. But I believe your Startup directory in the Nssm config is wrong -- it should be the userdir that I listed above.

#12

This configuration is correct?

#13

The NSSM configuration is correct.

If yes, then should be on the way to setting,js file

#14

C:\Users\xxxxx\AppData\Roaming\npm\node_modules\node-red\settings.js the port is 8000

C:\Users\xxxxx.node-red\settings.js, the port is 8080

Starting the service, the node red is running in port 1880

#15

The path you are showing is not correct... typically there is a hidden directory called .node-red underneath your user directory, not another directory with the extension ".node-red".

#16

The path correct is C:\Users\xxxxx\.node-red

it's this way

#17

But it's still not working the way it should.

#18

Do you have the env variable "PORT" set somewhere? Again, showing us the console log output would help...

#19

What is the path of the log file? I did not find it

#20

Executing this file normally opens: