pm2可以运行'npm start'脚本吗 [英] Can pm2 run an 'npm start' script
本文介绍了pm2可以运行'npm start'脚本吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pm2 有没有办法运行 npm start 脚本或者你只需要运行 pm2 start app.js
Is there a way for pm2 to run an npm start script or do you just have to run pm2 start app.js
正在开发中
npm start
然后在生产中使用 pm2 你会运行类似的东西
Then in production with pm2 you would run something like
pm2 start 'npm start'
在 forever
中有一种等效的方法可以做到这一点:
There is an equivalent way to do this in forever
:
forever start -c "npm start" ./
推荐答案
PM2 现在支持 npm start:
PM2 now supports npm start:
pm2 start npm -- start
要为 PM2 进程指定名称,请使用 --name
选项:
To assign a name to the PM2 process, use the --name
option:
pm2 start npm --name "app name" -- start
这篇关于pm2可以运行'npm start'脚本吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文