Is PM2 meant to be used during development process?

那年仲夏 提交于 2020-06-27 17:13:45

问题


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)?


回答1:


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 recommend 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.




回答2:


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



来源:https://stackoverflow.com/questions/51918704/is-pm2-meant-to-be-used-during-development-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!