问题
How to keep a node application running in windows even when user logs off? Also how to keep running a node http-server even after user log-off?
回答1:
You have 2 great options. One is as mentioned in comments above Forever.
The other is PM2 which is easy to install and offers an incredible amount of options. I use this in all projects, but I cannot attest to the Windows version as I am on Linux & Ubuntu servers and work on a Mac. You can daemonize your node process, follow logs, cluster it and make sure the process reboots even with a server shutdown (it is a service).
来源:https://stackoverflow.com/questions/42854148/keep-node-in-running-state-even-after-user-log-off