Fix · Node, npm and build
Port already in use (EADDRINUSE)
What you may see
- The dev server says port 3000 is already in use
- The server starts on a different port than I expect
Most likely cause
Another program (often an earlier copy of your own dev server) is already listening on that port.
Check first (about two minutes)
- Do you have another terminal tab running the same project? Close it with Ctrl+C.
The fix prompt
What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.
Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.
Prompt language
Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.
After you tried it, did it work?
Steps
- Run lsof -i :3000 (use my port number) and show me which program holds the port.
- If it is MY OWN old dev server, tell me how to stop it by its process number. If it is anything else, do not stop it; start my server on another port instead (for example npm run dev -- -p 3001).
- Start the server again and open the address it prints.
Do not do this
- Do not restart the computer first: it is usually one process.
- Do not stop processes you did not start, and do not use kill -9 on everything.