Cause 1 of 5
A previous run of the same server is still alive.
Find it and stop it. On macOS or Linux: lsof -i :3000 prints the PID, then kill <pid>. On Windows: netstat -ano | findstr :3000 then taskkill /PID <pid> /F. Send a plain kill first so the process can shut down cleanly; only escalate to kill -9 if it ignores that.
Cause 2 of 5
Another application owns the port.
Move rather than fight: PORT=3001 npm run dev, or change the port in your server config. Port 5000 on macOS is a common collision because AirPlay Receiver listens there.
Cause 3 of 5
A Docker container publishes the same host port.
docker ps shows the mappings. Stop that container with docker stop <name>, or republish it on a different host port with -p 3001:3000 — the left number is the host side and nothing inside the container changes.
Cause 4 of 5
The code calls listen() more than once.
Look for a second app.listen() — one in the module body and one in a test bootstrap is the classic pair. A watcher that re-executes the entry file without closing the old server produces the same symptom, so close it in the hot-reload dispose hook.
Cause 5 of 5
The process is a zombie held open by a child.
If the PID keeps coming back, the parent is respawning it. Stop the supervisor — the nodemon, pm2 or compose process that owns it — rather than the individual worker: pm2 list then pm2 stop <name>.