I have seen this behaviour before. Where something you do (either place the cursor or scroll back in a terminal) can pause the process.
The better solution is to run node-red as a service where you don't interact with the terminal. For logging purposes, something like NSSM can be used as a service runner. It can be set to redirect log output and errors to a file which you can follow and inspect at your leisure.
so I learn the nssm and able to run it in my dev pc, but now the problem is that my original node.js is really low that no node-red can run, I can not upgrade it because there is another app that use that node.js (v16.13.2), so I use virtual environment (python and then nodeenv if I am not wrong) to run node red on production server, so in my condition, can I still use nssm ?
My background as a Linux developer surely influences my opinion but I find running Node-red on Windows ridiculously difficult. Trying to use the oxymoronic "Non Sucking Service Manager" to make Node-red start up was the final straw for me.
I suggest you run Node-red on a Linux server. It does not need to be very powerful, an old miniPC or a Raspberry Pi should be sufficient, or a web based virtual server. Remember Node-red has a web based interface and you can access it with a browser from any PC on your network, regardless of where it is hosted.
The better solution for production use on Windows Server is to use iisnode as I already explained.
NSSM or PM2 are fine for development or on a workstation for casual use.
I would recommend that you don't, please look at iisnode. This is what Microsoft use for running Node.js microservices on Azure, it works fine on your own servers too. In fact, it looks like Microsoft themselves took over the library.
If you use iisnode, you should be able to avoid any other changes.
Completely. It isn't actually harder to do on Windows but, as I suggested, using NSSM is not the right tool for a production server.
There is nothing inherently wrong with any of the solutions. If you like complexity and all the moving pieces of iis, go for iisnode but note, it is no longer under active development.
I was suitably annoyed by iis to move away from iis/iisnode (it's awful)
Fortunately I no longer maintain windows servers.
If you take anything away from this thread, it should be that Linux is the better os for running node services.
Though, even as a Windows desktop adherent, I much prefer running Linux servers - I never found IIS that bad and never had any issues with iisnode (though I've mostly used it with Azure). I do like the AD/AAD integration though, it makes authentication soooo very easy.
Not denying that for sure. Also, a Linux server is almost certain to be more performant on the same tin.