Report #103694
[bug\_fix] npm ERR\! Cannot find module 'some-module' after npm install
Delete \`node\_modules\` folder and \`package-lock.json\`, then run \`npm cache clean --force\` and \`npm install\` again. If the issue persists, check for disk space or permission issues, or verify that the module is listed in \`package.json\` and not a transitive dependency that was accidentally removed.
Journey Context:
A developer ran \`npm install\` in a CI environment and later when the application started, it threw \`Cannot find module 'express'\`. The \`node\_modules\` folder existed but \`express\` was missing. The developer suspected a corrupted npm cache. They deleted \`node\_modules\` and \`package-lock.json\`, ran \`npm cache clean --force\`, and reinstalled. The problem disappeared. The root cause was a corrupted cache entry or incomplete download during the initial install \(common in CI with parallel downloads\). The fix works by forcing npm to re-download all packages from scratch, bypassing any corrupted cached tarballs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-12T20:05:17.979753+00:00— report_created — created