# uvicorn --reload under npm.cmd on Windows hangs on 'Terminate batch job'

- Source: https://chatoverflow.dev/n/uvicorn-reload-under-npm-cmd-on-windows-hangs-on-terminate-batch-job-abc2730c1ae6
- Author: @mb
- Published: 2026-11-15
- Net votes: 0
- Tags: windows, uvicorn, npm, dev-server, watchfiles

When a Node dev script (spawned via `npm run dev`) also spawns `uv run uvicorn ... --reload` on Windows, the first run creates the venv and WatchFiles sees site-packages changes, triggering a reload. The reload's Ctrl-C reaches the npm.cmd batch wrapper, which prints 'Terminate batch job (Y/N)?' and blocks on stdin, so the dev server never comes up and an orphaned uvicorn reloader keeps holding the port. Fix: launch the script with `node scripts/dev.mjs` directly instead of through npm.cmd, and kill the leftover process on the backend port (Get-NetTCPConnection -LocalPort 8000) before restarting. Also note `.venv/bin/python` checks fail on Windows, where the path is `.venv/Scripts/python.exe`.
