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
- Stop other terminals running dev servers (Ctrl+C).
- Find the process: macOS/Linux
lsof -i :3000; Windowsnetstat -ano | findstr :3000. - Kill it:
kill <PID>(macOS/Linux) ortaskkill /PID <PID> /F(Windows). - Or run on another port:
PORT=3001 npm run dev(Next.js also acceptsnext dev -p 3001).
Don't: Don't reboot every time. Find the process once.
Copy-paste fix prompt
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.
Did this fix it?
(Placeholder: feedback isn't recorded yet.)