Fix “port already in use” (EADDRINUSE)
Your dev server won’t start because something is already on port 3000? Find it and stop it in under a minute.
Find what is using the port
Replace 3000 with the port from your error message. The PID column is the process ID.
lsof -i :COMMAND PID USER FD TYPE NODE NAME node 48213 you 23u IPv6 TCP *:3000 (LISTEN)
Stop it gracefully
Use the PID from step 1. Most programs exit cleanly.
killStill stuck? Force it
This one-liner finds and force-kills everything on the port.
kill -9 $(lsof -ti :)Force-kills without letting the program save. Check with lsof -i first.
On Windows
Run this in PowerShell instead.
Stop-Process -Id (Get-NetTCPConnection -LocalPort ).OwningProcess -Force