首先安装
npm install -g node-dev
package.json 修改如下
{
"name": "server",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"dev":"node-dev ./bin/www"
},
"dependencies": {
"archiver": "^1.3.0",
"body-parser": "^1.17.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.3",
"express": "~4.15.2",
"express-session": "^1.15.3",
"jade": "~1.11.0",
"md5": "^2.2.1",
"morgan": "~1.8.1",
"serve-favicon": "~2.4.2"
}
}
用 npm run dev 启动