最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is PM2 meant to be used during development process? - Stack Overflow

programmeradmin8浏览0评论

I'm starting with Node.js world and I noticed that node process doesn't restart automatically.

Searching around I found that nodemon can do that work but I also found that PM2 is an alternative to nodemon. So should I try PM2 for development or just leave it for production and use nodemon for development (which seems very easy to setup)?

I'm starting with Node.js world and I noticed that node process doesn't restart automatically.

Searching around I found that nodemon can do that work but I also found that PM2 is an alternative to nodemon. So should I try PM2 for development or just leave it for production and use nodemon for development (which seems very easy to setup)?

Share Improve this question edited Aug 19, 2018 at 14:40 iSkore 7,5493 gold badges35 silver badges61 bronze badges asked Aug 19, 2018 at 14:35 chachanchachan 2,4621 gold badge28 silver badges43 bronze badges 1
  • 3 IMO, Nodemon works fine for development. – AKX Commented Aug 19, 2018 at 14:36
Add a ment  | 

2 Answers 2

Reset to default 6

A node process should not restart unless told to do so. You can use PM2 for development with the watch feature - similar results to nodemon. I remend PM2 if you want to pass in a bunch of environment variables from your PM2 ecosystem.config.js file. Otherwise, I’d use nodemon as @AKX said.

I will just add that there is pm2-dev utility http://pm2.keymetrics.io/docs/usage/pm2-development/ as well.

发布评论

评论列表(0)

  1. 暂无评论