【发布时间】:2017-10-05 18:55:11
【问题描述】:
我正在使用命令nodemon,并且第一次这样做时,localhost 正确地提供了所有文件。但是,当我进行任何更改时,或者当我退出 nodemon(ctrl + c) 并再次运行 nodemon 时,我会收到此错误:
events.js:182
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::3000
at Object._errnoException (util.js:1019:11)
at _exceptionWithHostPort (util.js:1041:20)
at Server.setupListenHandle [as _listen2] (net.js:1344:14)
at listenInCluster (net.js:1385:12)
at Server.listen (net.js:1469:7)
at Function.listen
(D:\Apps\NodeJs\Test\node_modules\express\
lib\application.js:
618:24)
at Object.<anonymous>
(D:\Apps\NodeJs\Test\app.js:95:5)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
[nodemon] app crashed - waiting for file changes before starting...
我注意到在我的进程中,Node.js:Server-side Javascript 正在运行,即使我已经杀死了我的 nodemon 进程。当我简单地运行node app.js 时,我没有问题。我知道该端口已被用于为我的文件提供服务,因此出现此错误,但我不确定为什么转义 nodemon 不会终止进程并再次释放端口?
【问题讨论】:
-
您是否在详细模式下运行 nodemon?是全局安装还是本地安装?请包含完整的命令。
标签: javascript node.js localhost nodemon