有没有办法让pm2运行npm启动脚本,或者您只需要运行pm2 start app.js
所以在开发过程中
npm start
然后,在使用pm2的生产环境中,您将运行如下内容
pm2 start 'npm start'
在forever
中有一种等效的方法可以做到这一点
forever start -c "npm start" ./
发布于 2022-01-29 14:21:52
您可以将目录更改为项目
cd /my-project
然后运行
pm2 start "npm run start" \\ run npm script from your package.json
阅读更多here
https://stackoverflow.com/questions/31579509
复制相似问题