Here's a bash script that will kill the process running on a specific port.
lsof -n -i4TCP:3000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
Just replace 3000
with the desired port you'd like to kill.
This should clear all your ports for you:
lsof -n -i4TCP:8080 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
lsof -n -i4TCP:8888 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
lsof -n -i4TCP:8000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9