pm2 は 'npm start' スクリプトを実行できますか? 質問する

pm2 は 'npm start' スクリプトを実行できますか? 質問する

pm2でnpm startスクリプトを実行する方法はありますか?それとも実行するだけですか?pm2 start app.js

開発中

npm start

そしてpm2の本番環境では次のように実行します。

pm2 start 'npm start'

これを行う同等の方法は、次のとおりですforever

forever start -c "npm start" ./

ベストアンサー1

PM2 は npm start をサポートするようになりました:

pm2 start npm -- start

PM2 プロセスに名前を割り当てるには、次の--nameオプションを使用します。

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

おすすめ記事