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.
Your fix plan
Generated locallyOr move your server to another port
Check these before you kill anything
You May Also Need
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.
| 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:3000owns 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?
How to Use EADDRINUSE Fix for Node.js
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.
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.
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.
OS: macOS Framework: Node.js core / Express Port: 3000
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
| 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 |
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?
How do I fix EADDRINUSE in Node.js?
Which command shows what is using port 3000?
How do I change the port in Next.js, Vite or Create React App?
Why does EADDRINUSE happen when nothing is listening on my port?
Is it safe to kill -9 the process using the port?
Methodology
Steps are ordered by operating system, framework and port state. Commands are reference guidance; the page never runs them.
Last updated .