Can pm2 run an 'npm start' script

前端 未结 17 1155
心在旅途
心在旅途 2020-12-04 04:45

Is there a way for pm2 to run an npm start script or do you just have to run pm2 start app.js

So in development

npm start

17条回答
  •  [愿得一人]
    2020-12-04 05:20

    pm2 start npm --name "custom_pm2_name" -- run prod

    "scripts": {
        "prod": "nodemon --exec babel-node ./src/index.js"
      }
    

    This worked for me when the others didnt

提交回复
热议问题