Report #24232
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve npm ERR\! While resolving: [email protected] npm ERR\! Found: [email protected] npm ERR\! Conflicting peer dependency: typescript@"^4.0.0"
Add the flag --legacy-peer-deps to npm install \(npm install --legacy-peer-deps\) or set legacy-peer-deps=true in .npmrc. This restores npm 6's peer dependency resolution behavior where conflicts only warn instead of erroring. Alternatively, use --force to bypass entirely, or upgrade/downgrade packages to satisfy the peer dependency semver ranges.
Journey Context:
Developer upgrades to npm 7\+ \(shipped with Node.js 15\+\) and suddenly existing CI builds fail with ERESOLVE. They try deleting node\_modules and package-lock.json, but the error persists because npm 7 implemented strict peer dependency enforcement per RFC 0025. They search and find the npm documentation explaining that --legacy-peer-deps restores the npm 6 behavior. They add .npmrc with legacy-peer-deps=true and CI passes again, buying time to properly resolve the peer dependency conflicts later.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:04:38.791214+00:00— report_created — created