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:
Error: listen EADDRINUSE: address already in use :::3001The :::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:
- A forgotten dev server. An old
node,nodemonornpm startfrom a closed terminal tab, an editor task or a crashed file watcher is still running. - 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 twoapp.listencalls in one app. Other ports failed the same way. - A Docker container publishes the port. The container, not a Node process, owns the port.
- A root-owned or other-user process holds it. Without
sudo,lsofonly lists files you have permission to examine, so these can be invisible. - 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:
lsof -nP -iTCP:3001 -sTCP:LISTENIt 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:
ps -p 12345 -o pid,ppid,commandReplace 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):
kill 12345Start 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:
const app = express();
app.listen(3001); // takes the port
app.listen(3001, () => console.log("up on 3001")); // emits EADDRINUSEIt is rarely this obvious. Search the project for every listen( and make sure exactly one runs per process. Typical hiding places:
- A
server.jsthat callslisten()and is also imported by a test, script orindex.jsthat 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:
sudo lsof -nP -iTCP:3001 -sTCP:LISTENThen list containers that publish the port:
docker ps --filter publish=3001If 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:
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
| Symptom | Likely cause | Fix |
|---|---|---|
lsof shows a node PID | Forgotten dev server | kill the PID (Fix 1) |
lsof shows nothing, app crashes at start | Double listen() | Search for listen( (Fix 2) |
| Other ports fail the same way | Double listen() | Fix 2 |
Only sudo lsof shows a row | Root or other-user process | Fix 3 |
Row names Docker or docker ps lists it | Container publishes 3001 | Stop the container |
Holder returns after kill | Watcher, restart policy or launch agent | Find 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.
- Open Procowl and press ⌘4 to go to Ports.
- In the Who is using port… field, type
3001.:3001andlocalhost:3001also work. - 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.
- 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
nodeprocess 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. Outsidestatusandtop, 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:LISTENprints nothing, with and withoutsudo.docker ps --filter publish=3001lists 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:
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 portCommon 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.