Can pm2 run an 'npm start' script

前端 未结 17 1224
心在旅途
心在旅途 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:17

    If you use PM2 via node modules instead of globally, you'll need to set interpreter: 'none' in order for the above solutions to work. Related docs here.

    In ecosystem.config.js:

      apps: [
        {
          name: 'myApp',
          script: 'yarn',
          args: 'start',
          interpreter: 'none',
        },
      ],
    

提交回复
热议问题