tzushanlin
5/15/2019 - 10:11 AM

Node / Express: EADDRINUSE, Address already in use - Kill server

如果得到錯誤指令如下

Error: listen EADDRINUSE: address already in use :::5000

解決方法:

First, you would want to know which process is using port 5000

$ lsof -i :5000

this will list all PID listening on this port, once you have the PID you can terminate it with the following

$ kill -9 {PID}