节点/快递:EADDRINUSE,地址已在使用 - 终止服务器 [英] Node / Express: EADDRINUSE, Address already in use - Kill server
本文介绍了节点/快递:EADDRINUSE,地址已在使用 - 终止服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I have a simple server running in node.js using connect:
var server = require('connect').createServer();
//actions...
server.listen(3000);
In my code I have actual handlers, but thats the basic idea. The problem I keep getting is
EADDRINUSE, Address already in use
I receive this error when running my application again after it previously crashed or errors. Since I am not opening a new instance of terminal I close out the process with ctr + z
.
I am fairly certain all I have to do is close out the server or connection. I tried calling server.close()
in process.on('exit', ...);
with no luck.
解决方案
I found this solution, try it
Give permission use sudo
sudo pkill node
这篇关于节点/快递:EADDRINUSE,地址已在使用 - 终止服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文