我想我必须更改我的package.json文件,但我不知道在哪里? 这是我的package.json
{
"name": "xyz",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "^1.13.3",
"cookie-parser": "~1.3.5",
"debug": "~2.2.0",
"express": "~4.13.1",
"jade": "~1.11.0",
"mongoose": "^4.4.5",
"morgan": "~1.6.1",
"serve-favicon": "~2.3.0"
}
}
答案 0 :(得分:2)
为main添加条目,如下所示,并执行nodemon
{
"name": "xyz",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"main": "./bin/www",
"dependencies": {
"body-parser": "^1.13.3",
"cookie-parser": "~1.3.5",
"debug": "~2.2.0",
"express": "~4.13.1",
"jade": "~1.11.0",
"mongoose": "^4.4.5",
"morgan": "~1.6.1",
"serve-favicon": "~2.3.0"
}
}
然后做
nodemon
现在应该与npm start
希望这有帮助!