Report #94443
[bug\_fix] ERESOLVE unable to resolve dependency tree
Run \`npm install --legacy-peer-deps\` or add an \`overrides\` field in package.json to force the conflicting peer dependency version. Root cause: npm v7\+ enforces strict peer dependency resolution; when two packages require incompatible peer versions \(e.g., React 17 vs 18\), the resolver cannot satisfy both constraints simultaneously, halting with ERESOLVE instead of the npm v6 behavior of ignoring the conflict.
Journey Context:
You upgrade to Node 16/18 and suddenly \`npm install\` fails on a project that worked yesterday. The error spews a cryptic tree showing "Could not resolve dependency: [email protected]" and "Conflicting peer dependency: react@^17.0.0". You try deleting node\_modules and package-lock.json—same error. You check if React is in your dependencies—yes, 18.2.0. The rabbit hole leads you to realize that one of your devDependencies \(like @storybook/react\) still declares React 17 as a peer dependency. npm v7\+, unlike v6, treats this as a hard error instead of a warning. You consider forcing React 17, but that breaks your app. The fix works because \`--legacy-peer-deps\` restores the npm v6 behavior where peer dependency conflicts are warnings, not fatal errors, allowing the install to proceed with the newer React version while the old package gets a silenced warning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:06:22.226202+00:00— report_created — created