3 ms·
I sometimes leave a process running on a port for webdev and then try to open a new one resulting in the error, "Error: listen EADDRINUSE 0.0.0.0:NNN", e.g. 0.0
by mstudio 4y ago
I sometimes leave a process running on a port for webdev and then try to open a new one resulting in the error, "Error: listen EADDRINUSE 0.0.0.0:NNN", e.g. 0.0.0.0:443.
There are many ways to search for the process, but here's what I use:
lsof -iTCP -sTCP:LISTEN -P | grep [PORT NUMBER]
Look for port num and kill the process with:
kill -9 [PID OF PROCESS YOU WANT TO KILL]
Note if running as root user, you will need to prepend the above commands with sudo