Error: listen EADDRINUSE: address already in use :::5000
Error: Port 3000 is already in use
Error: Lock file exists (.next/dev/lock)
- 11 node processes background mein chal rahe the
- Ports 3000 aur 5000 already busy the
- Next.js lock file stuck thi
- Purane dev servers properly band nahi hue the
Get-Process -Name node | Stop-Process -ForceRemove-Item -Path "lms/.next" -Recurse -ForceTest-NetConnection -Port 3000
Test-NetConnection -Port 5000npm run dev| Component | Status | URL | Response |
|---|---|---|---|
| Backend | ✅ Running | http://localhost:5000 | HTTP 200 OK |
| Frontend | ✅ Running | http://localhost:3000 | HTTP 200 OK |
| Health Check | ✅ Working | http://localhost:5000/api/health | {"ok":true} |
| Node Processes | ✅ Normal | 11 processes | (Backend + Frontend services) |
| Container | Status | Port | Purpose |
|---|---|---|---|
| lms-postgres | ✅ Running | 5432 | PostgreSQL Database |
| lms-mongodb | ✅ Running | 27017 | MongoDB Database |
Press Ctrl + C jahan npm run dev chal raha hai
Get-Process -Name node | Stop-Process -Force# Find process using port
netstat -ano | findstr :3000
netstat -ano | findstr :5000
# Kill by PID
taskkill /PID <PID_NUMBER> /F# 1. Check if ports are free
netstat -ano | findstr ":3000 :5000"
# 2. If busy, kill processes
Get-Process -Name node | Stop-Process -Force
# 3. Clean Next.js cache (optional)
Remove-Item -Path "lms/.next" -Recurse -Force
# 4. Start fresh
npm run dev# View all node processes
Get-Process -Name node
# Check specific ports
Test-NetConnection localhost -Port 3000
Test-NetConnection localhost -Port 5000
# See what's using ports
netstat -ano | findstr ":3000 :5000"# Stop all node processes
Get-Process -Name node | Stop-Process -Force
# Stop specific PID
Stop-Process -Id <PID> -Force# From root directory
npm run dev
# OR individually
npm run dev:backend
npm run dev:frontend- Check node processes:
Get-Process -Name node - Check ports:
netstat -ano | findstr ":3000 :5000" - Kill processes:
Get-Process -Name node | Stop-Process -Force - Clean cache:
Remove-Item "lms/.next" -Recurse -Force - Start fresh:
npm run dev
- ✅ Backend API responding
- ✅ Frontend loading
- ✅ No port conflicts
- ✅ Docker containers running
- ✅ Both databases connected
Happy Coding! 🚀