Juribiyan
Juribiyan

Reputation: 740

Node Error: EADDRINUSE, how do I find out what process is locking this address?

I have a test app using express that crashes on server.listen(80): ERROR: listen EADDRINUSE. I tried to kill all node processes with killall -9 node but there were no processes. I also have apache running on the same server but I've got two IPs and I have configured apache to serve only one of them and yesterday everything worked fine. Some process is blocking port 80 on IP reserved for node and it's not node. What should I do?

UPDATE

That was my own lame mistake. I defined node_ip and node_port but accidently omitted node_ip in server.listen.

Upvotes: 0

Views: 1939

Answers (3)

Paul
Paul

Reputation: 36339

if you want to see it first, you can use netstat, e.g.

netstat -tulpn | grep 80

Upvotes: 2

Alberto Zaccagni
Alberto Zaccagni

Reputation: 31580

You could use

 lsof -i :80

to see what process is running on that port.

Upvotes: 4

ziollek
ziollek

Reputation: 1993

You can use tcpkill ie.:

tcpkill -i eth0 port 80

Upvotes: 1

Related Questions