Skip to content
VibecodeZero

Error: listen EADDRINUSE: address already in use :::3000 (port 3000 or 5173 in use)

Updated First published

On this page (4)
  1. Symptom
  2. Cause
  3. Prompt to paste
  4. How not to burn credits

Symptom

The app won't start on your computer, and the terminal shows Error: listen EADDRINUSE: address already in use :::3000, or something like Port 3000 is in use or Port 5173 is already in use. The number can be different, like 3001, 5000, 5173 or 8080. Sometimes the app does start, but on another address than the one you opened.

Cause

Your app, when it runs on your computer, opens a small server so the browser can reach it at an address like http://localhost:3000. The number at the end is the port. Think of it as a door number: only one program can stand at each door at a time.

EADDRINUSE is how Node.js says that door is taken. It shows up when you run the app locally with npm run dev or npm start, for example a project from Cursor or Claude Code, or a Bolt or Lovable project you downloaded or pulled from GitHub. Next.js uses port 3000 by default and Vite uses 5173, so those are the numbers you see most.

It almost never means your code is broken. In most cases, the program in the way is your own app, still running from earlier:

  • in another terminal tab, or another editor window you forgot about;
  • in a terminal the AI agent opened to start the app, which keeps running after the chat moves on;
  • in a terminal that froze or was hidden, but whose process didn’t stop.

Less often, it’s a different project, or another program on your computer that uses the same port.

Beginner steps

  1. Stop the old copy. Look through your terminals, including the ones inside your editor. Find the one still showing the app’s output and press Ctrl+C (on Mac too). Then start the app again.
  2. Check if it already started somewhere else. Read the terminal again. If it says the app is running on another port, like 3001 or 5174, open that address. Nothing else to do.
  3. Use another port. If you can’t find the old copy, start this one on a different port:
    • Vite: npm run dev -- --port 5174
    • Next.js: npm run dev -- -p 3001
  4. Find and stop the process, on Mac or Linux. Open a terminal and run lsof -i :3000, changing the number to your port. Check the COMMAND column: your app usually shows up as node. Copy the number in the PID column and run kill 1234, using that number. If it’s still there after a few seconds, run kill -9 1234. If your Linux doesn’t have lsof, ss -ltnp lists the ports and the programs using them.
  5. Find and stop the process, on Windows. In Command Prompt or PowerShell, run netstat -ano | findstr :3000. The last number on the line marked LISTENING is the PID. Check what it is with tasklist /FI "PID eq 1234", then stop it with taskkill /PID 1234 /F.
  6. On Replit, press Stop, wait for it to finish, then press Run once. Pressing Run again while the app is still running can start a second copy.
  7. Start the app again, and open the address the terminal prints.

If none of this works, paste the prompt on this page with the full error. Ask the AI only for the commands, not for code changes.

If the terminal says npm itself isn’t found, see npm is not recognized or command not found. Once the app starts, the next error you see may be a missing package: see Cannot find module. If it starts but the page is empty, see My app shows a blank screen.

Prompt to paste

Copy the text below, replace what’s in brackets and send it in the chat of the tool you’re using.

Paste into the AI
When I try to start my app on my computer, the terminal shows this error:
[paste the whole error]

My computer is: [Mac / Windows / Linux].
I start the app with: [the command you run, for example npm run dev].

Don't change any code in the app. This is about a program that is already using the port.
Tell me, step by step, how to find out which program is using this port and how to stop it safely, with the exact commands for my computer. Tell me what to look for in the output before I stop anything, so I don't close something important.
Then tell me how to start the app on a different port instead, if I'd rather not stop anything.

How not to burn credits

  • Before you ask the AI, look through your open terminals, including the ones inside Cursor, VS Code or Claude Code, for one that is still running the app. Press Ctrl+C there. That fixes most cases without a single message.
  • This is not a bug in your code. If the AI starts editing files to fix a port error, stop it and say: don't change code, only help me free the port or use another one.
  • If the app actually started on another port, like 3001 or 5174, you don't need to fix anything. Open the address the terminal shows.

How Lovable counts credits, and what the free plan includes: Lovable credits explained.

Questions people ask

What does EADDRINUSE mean?

It's Node.js saying the address, meaning the port, is already in use. The :::3000 part means any address on your computer, port 3000. Your app tried to start a server on that port, but another program is already listening there, so Node.js stops.

Why is the port in use if I only have one app?

Usually because an older copy of the same app is still running. You may have started it in another terminal tab, in another editor window, or the AI agent started it in a terminal of its own. Closing the browser tab doesn't stop the app. Only stopping the process in the terminal does.

How do I stop the app that is using the port?

Go to the terminal where it's running and press Ctrl+C, on Mac too. If you can't find it, on Mac or Linux run lsof -i :3000 to see the program and its PID number, then kill followed by that number. On Windows, run netstat -ano | findstr :3000 to see the PID in the last column, then taskkill /PID followed by that number and /F.

How do I run the app on a different port?

Add a port to the start command. With Vite, run npm run dev -- --port 5174. With Next.js, run npm run dev -- -p 3001. The two dashes pass the option through npm to the dev server. Then open the new address, like http://localhost:3001.

Vite or Next.js started on 5174 or 3001. Is that a problem?

No. When the usual port is taken, Vite tries the next free one, and recent Next.js versions do the same and print a warning. The app works, just on another address. Open the one the terminal shows. If you'd rather keep the usual port, stop the old copy first.

Why does my Mac say port 5000 is already in use?

On recent versions of macOS, the AirPlay Receiver feature listens on port 5000, so apps that use 5000 by default can hit this error. Start your app on another port, or turn off AirPlay Receiver in System Settings if you don't use it.

Is it safe to kill the process?

It's safe when it's your own app, which usually shows up as node. Check the name first: lsof shows it in the COMMAND column on Mac and Linux, and on Windows tasklist /FI "PID eq 1234" shows the name for PID 1234. If it's something you don't recognize, use another port instead of stopping it.

New guides by email. An email when we publish a new guide, error fix or chapter, in plain English. Subscribe