nodejsbeginnernetworkingVerified
Node.js EADDRINUSE: Address Already in Use
Last reviewed: 9/14/2026
3 solutions
Exact Error Message
Error: listen EADDRINUSE: address already in use :::PORTQuick Fix
Kill the process using the port or use a different port: lsof -ti:PORT | xargs kill -9
What This Error Means
EADDRINUSE occurs when a Node.js application tries to bind to a port that's already occupied by another process. This commonly happens when a previous instance of the application didn't shut down properly.
Common Symptoms
- •Node.js application fails to start
- •Port binding error message
- •Application crashes on startup
- •Development server conflicts
Common Causes
- •Previous Node.js process still running
- •Another application using the port
- •Process didn't exit cleanly
- •Port conflict in development
- •Multiple instances starting simultaneously
Diagnostic Steps
- 1Identify which process is using the port
- 2Check if it's your own application
- 3Determine if process can be safely terminated
- 4Verify no critical services are using the port
Solutions
Solution 1: Kill the conflicting process
- 1Find process ID using the port
- 2Verify the process can be safely killed
- 3Kill the process
- 4Restart your application
Commands to Run
Killing processes may cause data loss if they're performing important operations
lsof -ti:PORT | xargs kill -9netstat -ano | findstr :PORT (Windows)taskkill /PID PID /F (Windows)Solution 2: Use a different port
- 1Choose an available port
- 2Update your application to use the new port
- 3Update any configuration files
- 4Restart application
Commands to Run
You may need to update load balancers or documentation with the new port
PORT=3001 node app.jsSolution 3: Implement graceful shutdown
- 1Add signal handlers in your application
- 2Close database connections on shutdown
- 3Clean up resources
- 4Exit process gracefully
Prevention Tips
- ✓Implement graceful shutdown in applications
- ✓Use process managers like PM2
- ✓Check port availability before starting
- ✓Use different ports for different environments
- ✓Clean up zombie processes regularly
Version Notes: Applies to Node.js 14+
Official Documentation
Related Errors
Was this helpful?