How do I restart Node Red without a Powershell window

I am on Windows 11, and start Node Red with the task scheduler at startup. This does not open a powershell window, so I cannot stop Node Red with a Ctrl-C or by closing the window. So when I want to restart Node Red, I close all node.js processes in the task manager, then open a powershell window and type node-red...
Is there a easier way ?

Task scheduler logs-in and runs the server in a background window, so you cannot see it.
If you want it to run in a visible window, where you can stop it with Ctrl-C, place a shortcut to the batch file in your "auto-start" folder.
Alternatively, you can run the Node-red Server batch file as a Windows "Service", using the utility NSSM.exe, and then stop/start it from the services pane.

Personally I run node-red on Windows under PM2. That lets you do various things including using the pm2 command to control what is running and view logs. It also lets you create a set of watches so that you can auto-restart node-red if certain things - like developing nodes, settings.js, etc change.

I run it manually though, I've never bothered to auto-start since I don't always need it running. I have a Windows Terminal configuration that starts the node-red PM2 config and displays the log output, I use package.json to simplify the startup command as well so that if I ctrl-c the open terminal window, I can make changes and then simply do npm restart to restart the PM2 session and re-show the log.

That looks interesting, not something I have ever used. Looking at the pm2 website, after installing pm2, I would open a powershell window, and type $ pm2 start node-red ?

Yes, or a cmd window, whatever preference you have. I think I'm using a cmd window simply because my PowerShell startup is a bit complex and so takes some time.

Windows terminal is a fantastic tool for devs by the way, I strongly recommend it on W10, it is the default now I think on W11. It gives you a multi-tabbed shell interface so you can have node-red, plain cmd, PowerShell, WSL and SSH all open together.

1 Like

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