借助于pm2-windows-service 可以把pm2以windows服务运行。已服务运行的好处就是,即时用户注销也,pm2也会在后台运行

  1. npm i pm2 -g
  2. npm i pm2-windows-service -g
  3. 安装服务:pm2-service-install -n myservice (安装后在windows服务中多了一个myservice的服务)##卸载pm2-service-uninstall
  4.  设置环境变量:PM2_SERVICE_SCRIPTS = PM2的配置文件
  5.  windows服务中重新启动myservice服务

相关文章:

  • 2021-07-24
  • 2021-08-15
  • 2021-11-21
  • 2021-07-16
  • 2022-12-23
猜你喜欢
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
相关资源
相似解决方案