Error: listen EADDRINUSE: address already in use
Another process is already using the port
Seen in Node.js, Python (Errno 98), Go (bind: address already in use), most servers
The server could not bind to its port because another process (often an old copy of the same app) is already listening on it.
Common causes
- A previous instance of the app is still running, for example a dev server that did not exit.
- A different service uses the same port.
- Two parts of the app try to listen on the same port.
How to fix it
- Find the process: lsof -i :3000 or ss -ltnp on Linux and macOS, netstat -ano | findstr :3000 on Windows.
- Stop that process, or run the app on another port (for example PORT=3001).
- Make sure the app calls listen() only once.
Got a different message? Paste it into the error explainer.
Related errors
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL
- curl: (77) error setting certificate verify locations · curl can't read its CA certificate bundle
- unexpected eof while reading · The peer closed the connection without a TLS close
- Error: write EPIPE · Wrote to a connection the other side had closed
- TypeError: fetch failed · Node.js fetch failed below HTTP
- Error: EMFILE: too many open files · The process ran out of file descriptors
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- wrong version number · TLS spoken to something that isn't TLS
- curl: (6) Could not resolve host · The hostname doesn't resolve