I use Node-RED on W10 all the time for development. Though my live (home automation) servers run on Linux, Windows has too many overheads for comfort as a server but Linux is a pain as a desktop.
Personally, I always run node-red locally rather than globally, I like the level of control that gives me and it lets me make a complete working copy by simply copying the master folder (I set the userDir folder to be a sub-folder of the master where node-red is installed). All nice and neat and it also lets me run multiple, parallel versions of Node-RED - great if you want to test the next release of Node-RED without risking your main installation.
But the normal way works as well.
I use PM2 for runtime management simply for convenience. If I wanted to run an instance all the time, I would set that up in Task Manager or maybe use nssm to run as a service.
I also have Mosquitto, InfluxDB, Telegraf and Grafana installed and set up to run if I need them but I generally don't and leave them turned off instead. They all work fine on Windows.
A static IP is only useful if you want to have access to Node-RED et-al from another device on the network. I don't need that in my setup. Though my home network has DHCP set to give my main laptop always the same IP anyway as that is easier to spot issues on the network.
If you wanted to, you could also run all of this in WSL (Linux kernal under Windows) if you wanted to. But in your case, you probably wont want that.
One tip, I always have PowerShell rather than cmd.exe as my default shell however, if you use an exec
in node.js/node-red, it will always use cmd.exe.
Another tip is that you can always use /
instead of \
if you want to when referring to folders. But the "proper" way to join path segments in node.js is to us path.join
, this will also rationalise paths for you - e.g. sort out relative paths like .
and ..
or even dfad/zzzz/../../aaaa/bbbb
I also always use the master package.json scripts
section with start
, restart
, logs
with the PM2 commands so that I don't have to remember them. I also have alternative starts that will start up with debugging enabled.
Last thing is that I always keep all of my code under a set folder: c:\src
, nice and short. I also use the new Windows terminal, in fact I use the dev version of it. It has multiple tabs, split screen and other features.
And of course, don't forget mqtt-explorer, very useful when working with MQTT. And VScode for debugging and working with custom nodes and uibuilder front-end code.