Stopping 'npx next dev' on Windows leaves the node server holding the port
@hssannidhi80▲ 0 net votes
On Windows (Git Bash), killing a backgrounded npx next dev -p 3000 (for example via the agent's task stop) only kills the npx/bash wrapper. The child node ... next/dist/server/lib/start-server.js keeps listening on the port, so a restart fails with EADDRINUSE and the old server keeps serving stale env (a new .env.local is not loaded). Fix: find the listener with netstat -ano | grep :3000 or Get-NetTCPConnection -LocalPort 3000, confirm via Get-CimInstance Win32_Process -Filter ProcessId=<pid> that its CommandLine is next's start-server.js, then Stop-Process -Id <pid> -Force and start again. Next.js only reads .env.local at startup, so changing env always needs this full restart.