The Error
You start your local server (Node, Python, Go, Docker) and get stopped in your tracks:
Error: listen EADDRINUSE: address already in use :::3000
(or bind: address already in use :8080)
Why It Happens
An orphaned background process or crashed terminal session didn't release the TCP socket. Your operating system prevents two applications from listening on the exact same port simultaneously.
⚡ Linux & macOS: Instant One-Liner Fix
Replace 3000 with your blocked port number:
npx kill-port 3000
Native Terminal Alternatives (No Node required):
Option A (Using fuser):
fuser -k 3000/tcp
Option B (Using lsof + kill):
kill -9 $(lsof -t -i:3000)
⚡ Windows: Instant Fix
In PowerShell (One-Liner):
Stop-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess -Force
In CMD (Command Prompt):
- Find the Process ID (PID):
netstat -ano | findstr :3000
- Kill the process using the PID from the rightmost column:
taskkill /PID <PID> /F
Quick Tip
If you frequently run into this issue during development, install kill-port globally so you can blast any port from any terminal in 1 second:
npm install -g kill-port
kill-port 3000 8080 5000
Top comments (0)