Report #101435
[bug\_fix] npm ERR\! EBUSY: resource busy or locked, rmdir 'node\_modules' on Windows
Close all processes holding handles to \`node\_modules\` \(IDEs, \`npm start\`, \`node.exe\`, \`tsc --watch\`, Docker mounts\), then run \`npm install\` again. If the lock persists, reboot or use Windows Resource Monitor / Process Explorer to find the handle, or rename the folder and recreate it instead of deleting.
Journey Context:
A developer on Windows runs \`rm -rf node\_modules\` followed by \`npm install\` and immediately gets \`EBUSY: resource busy or locked, rmdir ...\`. They have VS Code open, a Next.js dev server running in another terminal, and maybe a \`tsc --watch\` process. They first try running the command again, then try \`npm cache clean --force\`, neither of which works. They open Resource Monitor, search handles for the \`node\_modules\` path, kill the offending \`node.exe\` process, and the install succeeds. The cause is Windows file-system semantics: a directory cannot be deleted while any process holds an open handle inside it, whereas Unix can unlink in-use files and directories more freely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:50:38.177129+00:00— report_created — created