Facebook Pixel

What does EADDRINUSE mean?

Address already in use. Something is already running on that port. Either another server is up or your old process did not quit. Kill it or use a different port.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Express Port Binding and Listen Explained

It tells Node's HTTP module to listen on a port. Express calls http.createServer(app) under the hood. When a request arrives on that port, Express's middleware chain runs and dispatches to the handler.

Production environments (AWS, Heroku, Render) set their own port. Hardcoding 3000 means your server cannot bind there. Always use process.env.PORT || 3000 so it works in dev and prod.

If app.js only creates the app (no listen), you can import it in tests without binding to a port. server.js is the only file that calls listen. This pattern is small but useful for testing.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0