NodeLocal dev

Error: listen EADDRINUSE: address already in use :::3000

Error: listen EADDRINUSE: address already in use :::3000

In short: Another process (often an old copy of your dev server) is already using that port.

Why it happens

A previous npm run dev didn't shut down, an AI agent started a second server in another terminal, or a different app uses the same port.

How to fix it

  1. Stop other terminals running dev servers (Ctrl+C).
  2. Find the process: macOS/Linux lsof -i :3000; Windows netstat -ano | findstr :3000.
  3. Kill it: kill <PID> (macOS/Linux) or taskkill /PID <PID> /F (Windows).
  4. Or run on another port: PORT=3001 npm run dev (Next.js also accepts next dev -p 3001).
Don't: Don't reboot every time. Find the process once.

Copy-paste fix prompt

Paste into Cursor, Claude Code, Codex, Lovable, Bolt, Replit or v0
I'm getting this error in my app:

Error: listen EADDRINUSE: address already in use :::3000

[Paste the full error, stack trace, and the file it points to here]

Likely cause: Another process (often an old copy of your dev server) is already using that port.

Task: Check whether this project starts more than one server or doesn't shut down cleanly, and tell me the exact command to find and stop the process holding the port on my OS.

Rules:
- First explain the root cause in 2 sentences and list the files you'll change.
- Make the smallest change that fixes it. Don't refactor unrelated code.
- Don't disable security or checks (RLS, auth, signature verification, type checking, CORS allow-all) to make the error disappear.
- Never print or hard-code secret keys.
- Finish by telling me exactly how to verify the fix.

Common with: Cursor, Claude Code, Replit. Last reviewed 2026-11-13.

Related fixes

← All fixes · Still stuck? Use the diagnose-first prompt