Finds whatever process is holding a TCP port and kills it. Works on Windows, macOS and Linux. It is the quick fix for Error: listen EADDRINUSE: address already in use :::3000. No dependencies, no AI.
npm install -g @bobfromarcher/portkill
# or once:
npx @bobfromarcher/portkill 3000portkill <port> [options]
portkill --list| Option | Description |
|---|---|
--list, -l |
List every listening port and its owning process |
--force, -f |
Kill without the confirmation prompt |
--json |
Output JSON instead of killing |
-h, --help |
Show help |
-v, --version |
Show version |
portkill 3000 # find the process on :3000 and confirm before killing
portkill 8080 --force # kill it immediately, no prompt
portkill --list # everything that is listening, sorted by port
portkill 5432 --json # report the owner, do not killportkill shells out to the tools your OS already ships: netstat -ano and tasklist on Windows, lsof and ps on macOS and Linux. It parses their output and maps the port to a process. The parsing is pure and unit tested against captured fixtures from each platform, so behavior is the same everywhere. No native modules, nothing to compile.
git clone https://github.com/bobfromarcher/portkill
cd portkill
node test/test.jsCI runs the suite on Node 18, 20 and 22 across Linux, macOS and Windows.
MIT, bobfromarcher.