gpt4 book ai didi

node.js - pm2 可以运行 'npm start' 脚本吗

转载 作者:IT老高 更新时间:2023-10-28 21:46:18 26 4
gpt4 key购买 nike

有没有办法让 pm2 运行 npm start 脚本,还是只需要运行 pm2 start app.js

所以在开发中

npm start

然后在使用 pm2 进行生产时,您会运行类似

pm2 start 'npm start'

forever 中有一种等效的方法:

forever start -c "npm start" ./

最佳答案

PM2 现在支持 npm start:

pm2 start npm -- start

要为 PM2 进程指定名称,请使用 --name 选项:

pm2 start npm --name "app name" -- start

关于node.js - pm2 可以运行 'npm start' 脚本吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31579509/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com