Terminate Process on a Port from Command Line
Once a week I have to deal with a zombie process or try to start a process that's already running on its designated port. In most cases I use macOS's Activity Monitor to kill the process, which is time-consuming. What if we could just kill a process on a given port from command line? Well, we can!
To terminate a process on a given port, install
kill-port and starting nuking those zombies via:
# yarn global add kill-port
# Kill processes on multiple ports
kill-port 6060 8000
If you want to programmatically kill a port that you want to ensure your app will run on, you can do that as well:
const kill = require('kill-port')
I look forward to incorporating this library into my Node.js sites so that I can clear the way for a given port and avoid zombie processes.
Kids these days, I tell ya. All they care about is the technology. The video games. The bottled water. Oh, and the texting, always the texting. Back in my day, all we had was...OK, I had all of these things too. But I still don't get...
David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...