javascript - Start nodejs app that use cross-env with pm2 - Stack Overflow

I'm trying to start my nodejs app, the default cmd is the following : pm2 start app.jsI can't

I'm trying to start my nodejs app, the default cmd is the following :

pm2 start app.js

I can't do that because I use cross-env and the script as below:

"start": cross-env DOTENV_FILE=.env node build/app.js

So npm run start will launch the script above.

How can I serve my app using pm2 and the script above ?

I'm trying to start my nodejs app, the default cmd is the following :

pm2 start app.js

I can't do that because I use cross-env and the script as below:

"start": cross-env DOTENV_FILE=.env node build/app.js

So npm run start will launch the script above.

How can I serve my app using pm2 and the script above ?

Share Improve this question asked Oct 4, 2017 at 9:34 An-droidAn-droid 6,48510 gold badges51 silver badges95 bronze badges 1
  • Possible duplicate of Can pm2 run an 'npm start' script – David Commented Oct 4, 2017 at 9:39
Add a ment  | 

1 Answer 1

Reset to default 9

You can use:

pm2 start npm -- start

or

pm2 start npm --name CrossApp -- run start

Hope this helps

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742399869a4436695.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信