some useful command

@Shoaib

1/3. for mac

Check to see ports running in OS

sudo lsof -i -n -P | grep TCP

To kill a port

sudo lsof -iTCP:8080 -sTCP:LISTEN

You should get an output something like

COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
npm     12017 user   12u  IPv6 1876683      0t0  TCP *:8080 (LISTEN)

Now that you have the process ID(PID), you can kill the process. First try:

kill 12017 # (whatever the PID is)

If that does nothing, try:

kill -9 12017