npx kill-port 8080
kill -9 $(sudo lsof -ti:3000) # force kill one port
kill -9 $(sudo lsof -ti:3000,3001) # force kill multiple port
npx kill-port port_number
e.g,
npx kill-port 5001
kill -9 $(lsof -ti:3000,3001)
lsof -P | grep ':PortNumber' | awk '{print $2}' | xargs kill -9
Replace PortNumber with the actual port that you want to kill