EADDRINUSE Fix for Node.js

Generate the exact commands for your operating system that free the port — and understand why it was taken.

At a glance

EADDRINUSE means the port is already bound. Pick your OS, framework and port to get the exact commands that find the process holding it, stop it, and restart your Node.js server — or move it to a free port. Nothing runs or leaves your browser.

Which port is failing, and what is holding it?

Pick your operating system, how you run the server, and the port from the error message. You get an ordered find → stop → restart plan plus a move-port command for your framework. The page only prints commands — it never runs anything, and nothing leaves your browser.

Whole number 1–65535, e.g. 3000, 5173, 8080.

Command cheat sheet by operating system

These are the exact commands the generator prints, shown with port 3000 as the example. Replace 3000 with your port and <PID> with the number the find command reports.

Find, stop and force-stop commands for a busy TCP port on macOS, Linux and Windows
Task macOS Linux Windows
Find the process lsof -nP -iTCP:3000 -sTCP:LISTEN ss -ltnp 'sport = :3000' netstat -ano | findstr :3000
Stop gracefully kill <PID> kill <PID> taskkill /PID <PID>
Force stop (fallback) kill -9 <PID> kill -9 <PID> taskkill /PID <PID> /F
Nothing is listening? AirPlay Receiver can hold 5000/7000 check permissions (ss needs CAP for other users' PIDs) netsh interface ipv4 show excludedportrange protocol=tcp

Why is the port in use when nothing is listening?

  • A previous dev server never exited. Watchers such as nodemon or tsx watch can leave orphan child processes behind — closing the terminal does not always kill them.
  • macOS AirPlay Receiver. On Apple hardware, AirPlay Receiver listens on ports 5000 and 7000. If your server uses 5000, turn AirPlay off in System Settings → General → AirDrop & Handoff, or choose another port.
  • Windows reserved port ranges. Hyper-V, WSL2 and Docker Desktop can reserve dynamic ranges, so bind fails even though netstat shows nothing: check netsh interface ipv4 show excludedportrange protocol=tcp.
  • Docker port publishing. A container started with -p 3000:3000 owns the host port through the Docker engine — stop the container or publish a different host port.
  • Two projects, same default port. Many frameworks default to 3000 (Express, Next.js, CRA) or 5173 (Vite); running two projects at once collides. Give each project its own PORT.

Why Use This EADDRINUSE Fix for Node.js?

OS-correct commands: macOS/Linux (lsof, ss, kill), Windows (netstat, taskkill) and PowerShell variants — no guessing which forum answer applies to you
Find → stop → force-stop → restart plan generated in order, plus a framework-specific move-port recipe and a fallback port that skips reserved dev and service ports
Edge causes flagged when they apply: macOS AirPlay Receiver on 5000, Windows Hyper-V/WSL excluded port ranges, Docker host-port maps, orphaned nodemon/tsx watchers
Copy each command, copy the full plan, or download fix-commands.txt — the whole page runs locally and never executes the commands it prints

How to Use EADDRINUSE Fix for Node.js

1

Pick your operating system and framework

Choose macOS, Linux or Windows, then how you run the server: Node.js core/Express, Next.js, Vite, Create React App, NestJS, Nuxt 3, Docker, or other.

2

Enter the port that is failing

Type the port from the error message (for example 3000, 5173 or 8080). Privileged and common-service ports get an extra warning note.

3

Run the generated commands in order

Copy the find command, replace <PID> with the number it prints, stop the process, then restart your server — or use the printed port-change command instead.

Freeing port 3000 on macOS (Node.js / Express)

The engine maps the selected OS, framework and port to ordered, copy-paste commands — it never executes anything. Run the find command, replace <PID> with the number it prints, then restart your server or use the printed PORT command.

Generator inputs Source
OS: macOS
Framework: Node.js core / Express
Port: 3000
Generated fix plan (exact) Processed
1) Find the listener: lsof -nP -iTCP:3000 -sTCP:LISTEN
2) Stop it: kill <PID> (force: kill -9 <PID>)
3) Restart: npm run dev
Or move the port: PORT=3001 node server.js
Suggested spare port: 3001

Technical Specifications & Engine Details

Technical specifications and engine details for EADDRINUSE Fix for Node.js
Specification Details
Error covered EADDRINUSE — listen: address already in use ([::]:<port>)
Platforms macOS, Linux, Windows (cmd + PowerShell command variants)
Frameworks Node.js core / Express, Next.js, Vite, Create React App, NestJS, Nuxt 3, Docker, other
Output Ordered find → stop → restart commands, a move-port recipe and a reserved-port-safe fallback port
Execution mode 100% client-side decision mapper — commands are rendered for you to copy, never executed
Limits Cannot inspect your machine; exotic setups (remote tunnels, Kubernetes port-forward) get generic guidance
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your selections and the generated commands stay on your device. Zero data is transmitted to external servers, and no command is ever executed by this page.

Frequently Asked Questions

What does EADDRINUSE mean in Node.js?
EADDRINUSE means the address and port you tried to listen on is already bound by another socket, so Node cannot start your server. The fix is to stop the process holding the port or start your app on a different one.
How do I fix EADDRINUSE in Node.js?
Find the process holding the port, stop it, then restart your server — or move the app to another port with the PORT environment variable. The generator above prints the exact commands for macOS, Linux or Windows.
Which command shows what is using port 3000?
On macOS run lsof -nP -iTCP:3000 -sTCP:LISTEN; on Linux run ss -ltnp 'sport = :3000' or lsof; on Windows run netstat -ano | findstr :3000 and read the PID from the last column.
How do I change the port in Next.js, Vite or Create React App?
Next.js: next dev -p 3001; Vite: vite --port 3001; Create React App: PORT=3001 npm start (set PORT=3001 && npm start in Windows cmd). Express and NestJS read process.env.PORT, so PORT=3001 node server.js works.
Why does EADDRINUSE happen when nothing is listening on my port?
The usual causes are an OS-reserved port range on Windows (Hyper-V/WSL), macOS AirPlay Receiver on port 5000, a Docker container publishing the port, or an orphaned watcher process that survived the terminal closing. The generator flags the ones that apply to your selection.
Is it safe to kill -9 the process using the port?
Prefer a graceful stop first (kill <pid> on macOS/Linux, taskkill /PID <pid> on Windows) so the process can flush and release resources; use kill -9 or taskkill /F only when the graceful stop does not work.

Methodology

Steps are ordered by operating system, framework and port state. Commands are reference guidance; the page never runs them.

Last updated .