How to kill a process running on a particular port
In this article, we will show you how to kill a process running on a particular port.
When you are working with Angular, React or Node/Express projects you may see an error like
Port 4200 is already in use or
Error: Listen EADDRINUSE: Address already in use.
Let’s try to kill the process running on the
For linux users:
sudo kill $(sudo lsof -t -i:4200)
You could also try this:
sudo kill `sudo lsof -t -i:4200`
For windows users:
Open the cmd as administrator. Type below command in cmd.
netstat -a -n -o
And then, find a port with port number
4200. Let’s say we found that port number
4200 is used by pid
18932. Run the following command.
taskkill -f /pid 18932
I hope you find this article helpful.
Thank you for reading. Happy Coding..!! 🙂