Node.js: `EADDRINUSE: address already in use :::3000`
poze 4 months ago206 gadeen
3
2 Repons
5
✓✓ Repons yo aksepte
Ctrl+Z suspends the process, it doesn't stop it. It's still holding port 3000. Use Ctrl+C to stop a server.
To find and kill whatever is on the port:
macOS / Linux
lsof -i :3000
kill <PID>
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 3000 | Select OwningProcess
Stop-Process -Id <PID>
Or use npx kill-port 3000 on any OS.
Konekte pou di lòt moun si li te mache.
answered 4 months ago
David Charles 2.9k
1
In dev, it's also handy to read the port from the environment so you can just pick another one: const port = process.env.PORT ?? 3000; and then PORT=3001 npm run dev.
Konekte pou di lòt moun si li te mache.
answered 4 months ago
Jean Pierre 5.1k
Sign in and verify your email to post an answer.