Skip to content
nkNilay Kabariya

Entry No.003·Fixes··1 min read

Fix: EADDRINUSE address already in use :::3000 on Windows

Your Node dev server won't start because the port is taken. Find the process holding it, stop it, and restart. Every step reproduced on Windows 11.

by Nilay#node#windows#devserverFIXED

The error, verbatim

Jump to the fix ↓
node:events:486
      throw er; // Unhandled 'error' event
      ^
Error: listen EADDRINUSE: address already in use :::3000
    at Server.setupListenHandle [as _listen2] (node:net:1948:16)
    at listenInCluster (node:net:2005:12)
    at Server.listen (node:net:2110:7)

Tested on

Node
24.14.0
OS
Windows 11 Pro
Shells
PowerShell 5.1, cmd
Contents
  1. The fix01
  2. Check what you’re about to stop02
  3. Or just use another port03
  4. Why it happens04
  5. What didn’t work05

The fix

Another process is already listening on the port. Find its process ID (PID), stop it, then start your server again.

PowerShell:

Get-NetTCPConnection -LocalPort 3000 -State Listen | Select-Object OwningProcess
Stop-Process -Id <PID> -Force

Command Prompt:

netstat -ano | findstr :3000
taskkill /PID <PID> /F

In netstat, the PID is the last number on the LISTENING line:

TCP    0.0.0.0:3000    0.0.0.0:0    LISTENING    11156

Check what you’re about to stop

The PID might be a dev server from another project that you still need. Look before you stop it:

Get-Process -Id <PID>

Or just use another port

Most dev servers accept a port flag or a PORT environment variable:

npx next dev -p 3001
npx vite --port 5174

For your own Node server, read the port from the environment so it’s easy to change:

const port = Number(process.env.PORT) || 3000;
server.listen(port);

Why it happens

Only one process can listen on a given port at a time. The usual culprits:

  • a dev server still running in another terminal tab or editor window
  • a server from a crashed or closed session that’s still running in the background
  • two projects that both default to port 3000

What didn’t work

— N.K., end of entry No.003

Useful? Pass it on:Post on X

Related entries

  1. No.005

    Fix: ERR_REQUIRE_ESM require() of ES Module not supported

    Why require() of an ES module fails, why it mostly stopped failing on Node 22.12+, and the new errors you hit instead. All reproduced on Node 24.

    > Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\chalk\source\index.js

    FIXED1 min
  2. No.004

    Fix: ERR_OSSL_EVP_UNSUPPORTED digital envelope routines (webpack 4)

    Old webpack 4 builds crash on Node 17+ with 0308010C. Upgrading webpack 4 to 4.47.0 fixes it without the legacy OpenSSL flag. Reproduced on Node 24.

    > Error: error:0308010C:digital envelope routines::unsupported

    FIXED1 min
  3. No.002

    Fix: __dirname is not defined in ES module scope (Node 24)

    ES modules don't have __dirname or __filename. The one-line modern fix (import.meta.dirname) and the fallback for older Node, both run on Node 24.

    > console.log(path.join(__dirname, "data.json"));

    FIXED1 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSS

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text