Skip to content
86% off$349 $48.86code BF2026

Guides

Fix EADDRINUSE address already in use :::3001 on Mac

EADDRINUSE :::3001 but nothing seems to be running? Find what holds port 3001 on Mac with lsof or Procowl, or catch a second listen() call.

TroubleshootingUpdated 7 min read

On this page

You start your dev server and get this, yet a check finds no process on that port:

text
Error: listen EADDRINUSE: address already in use :::3001

The :::3001 is the address Node tried to bind: :: (all IPv6 interfaces), then the port. The port number is the part that matters. The error means the operating system refused the bind because another socket already holds it.

Why it happens

Most common first:

  1. A forgotten dev server. An old node, nodemon or npm start from a closed terminal tab, an editor task or a crashed file watcher is still running.
  2. Your own code binds twice. Two listen() calls in the same process (or a second file that also starts the server). This is the likely answer when nothing shows up. In the Reddit thread this page was written for, the poster saw the error with no visible process, and the cause turned out to be two app.listen calls in one app. Other ports failed the same way.
  3. A Docker container publishes the port. The container, not a Node process, owns the port.
  4. A root-owned or other-user process holds it. Without sudo, lsof only lists files you have permission to examine, so these can be invisible.
  5. Something restarts the holder. A file watcher, a container restart policy or a launch agent brings it back after you kill it.

When the error crashes your app, the app exits and frees the port, so by the time you run a check there is nothing left. That is why the "no process running" report is so common.

Fix 1: Find the process that holds port 3001

Run this in Terminal:

bash
lsof -nP -iTCP:3001 -sTCP:LISTEN

It lists processes with a TCP socket listening on port 3001. -n and -P stop name lookups, so the output stays literal. It only reads, so there is nothing to undo.

If a row comes back, the PID column is your target. Check what it is first:

bash
ps -p 12345 -o pid,ppid,command

Replace 12345 with the PID. This prints the full command line. A PPID of 1 means the original parent is gone, typical of a leftover from a closed tab.

Then ask it to exit cleanly (SIGTERM):

bash
kill 12345

Start your app again. If the port is still held a few seconds later, the process ignored the request.

Fix 2: Look for a second listen() call

If lsof prints nothing, check your code. The second call below fails because the first already took the port:

js
const app = express();

app.listen(3001);                                   // takes the port
app.listen(3001, () => console.log("up on 3001"));  // emits EADDRINUSE

It is rarely this obvious. Search the project for every listen( and make sure exactly one runs per process. Typical hiding places:

  • A server.js that calls listen() and is also imported by a test, script or index.js that calls it again.
  • A framework or tool that already starts the server while your code starts one too.
  • A module whose top-level code runs again on hot reload and creates a new server each time.
  • Two scripts in package.json, or a watcher in one tab and a manual run in another.

To confirm: if your app stays up after you remove the duplicate, run the lsof command from Fix 1. If your own node process shows as the holder, the first listen() worked and a later one failed.

Fix 3: Check for root, other-user and Docker holders

Run the lookup with elevated rights:

bash
sudo lsof -nP -iTCP:3001 -sTCP:LISTEN

Then list containers that publish the port:

bash
docker ps --filter publish=3001

If a container shows up, stop it from Docker or change its published port. Killing the process behind it only fights the container.

Fix 4: Use another port

If you don't need 3001 specifically, read the port from the environment:

js
const port = process.env.PORT || 3001;
app.listen(port);

Then run PORT=3002 npm start. This sidesteps the conflict without explaining it. If a double listen() is the cause, the same error follows you to the next port.

Packages such as get-port pick a free port for you in code. They help with tests and parallel servers, but they also hide a duplicate bind, so find the cause first.

Which cause matches which symptom

SymptomLikely causeFix
lsof shows a node PIDForgotten dev serverkill the PID (Fix 1)
lsof shows nothing, app crashes at startDouble listen()Search for listen( (Fix 2)
Other ports fail the same wayDouble listen()Fix 2
Only sudo lsof shows a rowRoot or other-user processFix 3
Row names Docker or docker ps lists itContainer publishes 3001Stop the container
Holder returns after killWatcher, restart policy or launch agentFind what relaunches it

What about npx kill-port?

npx kill-port 3001 ends whatever holds the port in one command. It needs Node.js and npm, works by port number only, and doesn't show you what it is about to kill. As of November 2026, npm lists 2.0.1 as its latest version, published about four years ago.

It is fine for a quick check. It won't fix a double listen(): if the holder is your own app's first listener, it just kills your app.

See the port holder in Procowl

The Terminal route is enough for a one-off. If you hit this often, Procowl, our Mac process monitor (macOS 14 Sonoma or later), shows the same answer in a window.

  1. Open Procowl and press ⌘4 to go to Ports.
  2. In the Who is using port… field, type 3001. :3001 and localhost:3001 also work.
  3. Read the row: the port, protocol and endpoint, and whether it is This Mac only or Reachable from the network. Click the process name to jump to it in Processes.
  4. Choose Stop… to quit it. Procowl asks before it sends anything.

Other parts that help with this error:

  • A Docker container tag appears on the row when a running container publishes the port.
  • Projects (⌘5) groups dev servers by project folder, so you can tell which repo a forgotten server belongs to.
  • In Processes, the toolbar search accepts port:3001.
  • Processes > Ended recently lists processes that quit in the last 10 minutes, with name, PID and run time. That shows your node process starting and exiting fast. A Restarting ×N badge marks one that ended and restarted 3 or more times in 10 minutes.
  • For Terminal, install the tool from Settings ▸ General ▸ Command-Line Tool ▸ Install…, then run procowl port 3001. It exits with code 1 if nothing matched. Outside status and top, the commands need Procowl to be licensed or in its trial.

The limit matches lsof without sudo: Procowl scans the sockets of your own processes only. For root-owned holders it says "System services (root) are hidden without admin rights," and Enhanced Access doesn't change that, so use sudo lsof there. If it reports nothing of yours listening on 3001, that matches an empty lsof and points back to Fix 2.

Procowl is part of MacSuite, and you can try it free for 7 days. More detail is in the Ports, dev servers and Docker docs, the procowl command-line docs and how to kill a process on a port on Mac.

Checklist before you try again

  • lsof -nP -iTCP:3001 -sTCP:LISTEN prints nothing, with and without sudo.
  • docker ps --filter publish=3001 lists nothing.
  • Exactly one listen( call runs per process.
  • You aren't running the app in two tabs, or twice from package.json.

If nothing works

A holder that returns after kill is being restarted. In Procowl, select the process and check Launched by in the inspector; it names the matching launchd plist if there is one. Procowl only reads launch agents and never changes them. If a different process holds the port each time, run the lsof command right after login, before your app starts, to see who claims 3001 first.

When you ask the Node.js or framework community for help, include the full error with its stack trace, which shows the line that calls listen(). If you contact Procowl support, send the details below via the MacSuite support page:

text
Subject: Port 3001 reported in use but nothing found

Error: listen EADDRINUSE: address already in use :::3001
macOS version: 
Node version: 
Output of: lsof -nP -iTCP:3001 -sTCP:LISTEN (with and without sudo):
Output of: docker ps --filter publish=3001:
What I tried: kill, searching for duplicate listen() calls, another port

Common questions

Why does the error say :::3001 and not 0.0.0.0:3001?

Node binds to all IPv6 addresses (::) by default when no host is given, and the OS usually accepts IPv4 connections on that socket too. The lsof command above covers both IPv4 and IPv6.

Can I find the holder without lsof?

Yes. Procowl's Ports view, procowl port 3001, or Activity Monitor (which doesn't show ports) paired with the process list. For ports specifically, lsof or Procowl are the direct routes.

Is it safe to kill whatever is on 3001?

Only after you check the command line with ps. A node process in your project folder is safe to stop. A database, Docker backend or system service is not something to kill casually.

Does restarting my Mac fix it?

It clears forgotten processes, but not a double listen() or a container that starts at login, so the error comes back.

Every app.
One purchase.