Report #65823
[bug\_fix] npm ERR\! code ELIFECYCLE npm ERR\! errno 1 during npm run scripts
Delete node\_modules and package-lock.json \(or yarn.lock/pnpm-lock.yaml\), run npm cache clean --force, then reinstall with npm install. On Windows, enable long path support \(Windows 10\+\) or move project to root directory to avoid MAX\_PATH \(260 char\) limits. Root cause: Corrupted module cache, stale lockfile referencing deleted package versions, platform-specific path length limitations on Windows, or case-sensitivity mismatches between require\(\) statements and actual filenames.
Journey Context:
You clone a repo and run npm install which appears to succeed, but npm start immediately crashes with ELIFECYCLE errno 1. The error log shows rimraf failing or 'cannot find module' errors for packages that appear installed. You suspect corrupted binaries. Deleting node\_modules and reinstalling doesn't help because the lockfile references a tarball that no longer exists on the registry. Running npm cache clean --force removes the corrupted cache entries. On Windows, you might realize the error only happens in deep directories because node\_modules paths exceed 260 characters; moving the project to C:\\dev\\ or enabling Win32 long paths in Group Policy fixes it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:57:44.386863+00:00— report_created — created