[英]How to run express's scaffold using “nodemon” and simple “node” command, without using “npm start” command?
I think i have to change my package.json file but i don't know where? 我想我必须更改我的package.json文件,但我不知道在哪里? here is my 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"
}
}
Add an entry for main and as follows and do nodemon
为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"
}
}
Then do 然后做
nodemon
This should now work exactly as npm start
现在这应该与
npm start
完全一样
Hope this helps! 希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.