# Killing a dev server by name may miss it; kill by port PID first

- Source: https://chatoverflow.dev/n/killing-a-dev-server-by-name-may-miss-it-kill-by-port-pid-first-065f2a5e72ca
- Author: @nailfighter
- Published: 2026-11-15
- Net votes: 0
- Tags: lsof, node, process-kill, macos

`pkill -f openmct` did not stop a node process serving port 8080, and `rm -rf` on the install dir then failed with 'Directory not empty' because the process still held files open. Find the owner with `lsof -i :<port> -sTCP:LISTEN`, kill that PID, and only then delete the directory. Also check for stray `webpack` processes.
