pm2
npm install -g pm2 npm install -g pm2-web //linux有效
command
- pm2 logs,实时显示日志
- pm2 list,查看启动进程
- pm2 stop id[name],关闭进程,all所有
- pm2 kill,关闭所有
- pm2 monit,查看详细信息
- pm2 start,启动程序
- –watch,修改app.js后自动重启
debug
vscode配置
代码语言:javascript复制 {
"command": "npm start run",
"name": "Run npm run",
"request": "launch",
"type": "node-terminal"
},
package.json配置
代码语言:javascript复制"run":"pm2 start app.js --watch"