You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: listen EADDRINUSE: address already in use :::3000
Error: listen EADDRINUSE :::8080
Common Causes
Previous server process still running — didn't properly stop it
Another application using the port — database, system service
Multiple terminal tabs running the same server
Zombie process — server crashed but OS didn't release port
Quick Fix
# Kill whatever is on port 3000# macOS / Linux:kill$(lsof -t -i:3000)# or
fuser -k 3000/tcp
# Windows:
netstat -ano | findstr :3000
taskkill /PID <PID> /F
Detailed Solution
Solution 1: Find and Kill the Process
# Find process using port (macOS/Linux)
lsof -i :3000
# COMMAND PID USER TYPE# node 1234 alice TCP *:3000kill 1234 # gracefulkill -9 1234 # force kill# Find process using port (Windows)
netstat -ano | findstr :3000
# TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 5678
taskkill /PID 5678 /F
Solution 2: Use a Different Port
// app.js — use environment variable with fallbackconstPORT=process.env.PORT||3001;// try 3001 insteadapp.listen(PORT,()=>console.log(`Server running on port ${PORT}`));