Introduction
Many of us have probably tried running our server on a port such as localhost:3000
or development environment on the same port.
There's also the time where we closed our terminal without killing our port. This brings up a:
EADDRINUSE: address already in use :::3000
...error message (your port number could be different)
This quick guide will show you how to find the port and kill it in two simple commands.
Steps
- Get the PID of the port you want to kill. In terminal type the following
sudo lsof -i :3000 # The port # here should be the one giving issue
A series of information should appear on your screen. Take note of the PID number.
- Type the following command to kill the port with the PID you specified:
kill -9 <PID>
Conclusion
Now since you killed the port you should be free to reuse it!
Top comments (0)