in Linux, macOS

Find and kill process port on macOS


Find
  1. Using netstat
    netstat -vanp tcp | grep 3000
    
  2. For macOS and newer (or if your netstat doesn’t support -p), use lsof
    lsof -i tcp:3000
Kill
kill -9 <PID>