使用supervisor提高nodejs调试效率

1、安装supervisor

直接用npm安装既可,键入命令: npm -g install supervisor。如果不行,检查电脑有没有联网,联网后输入

sudo npm -g install supervisor

2、supervisor的使用

用cd命令定位到项目的根目录

输入以下的命令

supervisor bin/www

请注意:这里无需npm start 命令

change directory:

$ cd blogs

install dependencies:

$ npm install

run the app:

$ DEBUG=blogs:* npm start

大功告成