Node.js http服务器在使用Ctrl+C时未停止服务器
我使用一个简单的npm模块http服务器来服务器静态网站。 这是我的json包Node.js http服务器在使用Ctrl+C时未停止服务器,node.js,npm,web-hosting,httpserver,Node.js,Npm,Web Hosting,Httpserver,我使用一个简单的npm模块http服务器来服务器静态网站。 这是我的json包 { "name": "dashboard-ng-starfleet", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start":"./node_modules/http-se
{
"name": "dashboard-ng-starfleet",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"./node_modules/http-server/bin/http-server -p=8080"
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"homepage": "",
"devDependencies": {
"http-server": "^0.10.0"
}
}
服务器启动一次,但一旦我在终端中使用Ctrl+C停止它并再次启动服务器,它就会显示地址已在使用中。
理想情况下,它应该停止
有什么帮助吗?您的开始脚本应该是
"start":"./node_modules/http-server/bin/http-server -p 8080"
已在项目问题跟踪中提到