ProjectStack
npm

Error: listen EADDRINUSE — address already in use

The port your Node.js server is trying to listen on is already occupied by another process. Two servers can't bind to the same port at the same time.

Common causes

  • You already have a server running from a previous terminal session
  • Another application (a different dev server, database, or service) is using the same port
  • A previous server process crashed without properly releasing the port
  • You started the server twice accidentally

How to fix it

  1. Find and kill the process using the port — on Mac/Linux: lsof -ti:3000 | xargs kill
  2. On Windows: netstat -ano | findstr :3000, then taskkill /PID <pid> /F
  3. Change the port in your app config: PORT=3001 npm start
  4. Check if you have multiple terminal tabs with the server running

Example

Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as _listen2] (node:net:1897:16) at listenInCluster (node:net:1945:12)

Starting a Node.js Express server when port 3000 is already in use by a previous server instance

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.