Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the `PM2` for command `yarn run start`?

I run the nodejs app with yarn run start , what is the command for pm2 I should use?

pm2 yarn run start give me an error.

My package.json content

"scripts": {
    "start": "budo main.js:dist/bundle.js --live --host 0.0.0.0",
    "watch": "watchify main.js -v --debug -o dist/bundle.js",
    "prep": "yarn && mkdirp dist",
    "build": "browserify main.js -o dist/bundle.js",
    "lint": "eslint main.js --fix",
    "deploy": "yarn build && uglifyjs dist/bundle.js -c -m -o dist/bundle.min.js"
  },
like image 588
kn3l Avatar asked Nov 26 '19 08:11

kn3l


1 Answers

For me (on ubuntu 20)

pm2 start yarn --name api -- start

would do the trick. With the bash interpreter flag it would error in pm2.

like image 190
Christoph Kempen Avatar answered Sep 18 '22 13:09

Christoph Kempen