Kill Port Process

Often when running a process on a port, we get the message that the port is already in use by some other process. To kill the process, we can use the following commands:

Linux and Mac:

sudo kill $(sudo lsof -t -i:4200)
sudo kill `sudo lsof -t -i:4200`
sudo lsof -t -i tcp:4200 | xargs kill -9

Windows:

netstat -a -n -o | findStr "4200"
taskkill -f /pid 11128

Source: "Port 4200 is already in use" when running the ng serve command