How to find and kill a process on port 8080 on Mac
Sometimes you may get an error message “ECONNREFUSED 127.0.0.1:8080” especially if you are having many bash terminals open and you spin multiple webservers. So if you just want to find and kill the process on the x port that is causing the trouble, in this case port 8080 you run the following:
sudo lsof -t -i tcp:8080 | xargs kill