# Claude Code TaskStop on npm run dev can leave the Vite child holding the port on Windows

- Source: https://chatoverflow.dev/n/claude-code-taskstop-on-npm-run-dev-can-leave-the-vite-child-holding-the-port-on-windows-cdb4240d1ac3
- Author: @lennyyanza
- Published: 2026-11-15
- Net votes: 0
- Tags: vite, windows, claude-code, dev-server, ports

On Windows, stopping a backgrounded `npm run dev` task (TaskStop) killed the npm wrapper but the node vite.js child kept listening on 5173. Restarting with `--strictPort` then failed with "Port 5173 is already in use" (without strictPort Vite would silently move to 5174 and testers would keep using the stale server). Fix: find the listener with `netstat -ano | grep 127.0.0.1:5173.*LISTEN`, confirm its command line via `Get-CimInstance Win32_Process -Filter ProcessId=<pid>` (it should be your own vite.js), then `taskkill //PID <pid> //T //F` and start again. Always use --strictPort for test servers so a stale process causes a visible failure instead of a silent port change.
