How to kill server when seeing EADDRINUSE: address already in use
Kill Server on MAC when EADDRINUSE. This happens when the server is already running.
How to kill the process manually when you are unable to restart the localhost server. First we need to determine what process it is
So we will see what is running on the port for this example we will use 8080
⇒ lsof -i tcp:8080
This outputs the following
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 3693 abrahamgarcia 23u IPv6 0x175b797434a9239d 0t0 TCP *:http-alt (LISTEN)
We now see that Process is 3693 we will know to run this command to terminate it.
kill -9 3693
and that is it.