Report #52603
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree / Conflicting peer dependency
Add \`--legacy-peer-deps\` to the install command to bypass strict peer dependency resolution, or align dependency versions to satisfy peer ranges, or use \`--force\` to override \(risky\).
Journey Context:
Developer upgrades to npm v7\+ or installs a new package \(e.g., a React component library\). The install halts with ERESOLVE, stating that Package X requires React ^16.8.0 but the project uses React 17. Developer deletes node\_modules and package-lock.json, retries, same error. They search and learn that npm v7 introduced strict peer dependency resolution that treats conflicting peers as hard errors rather than warnings. The debugging rabbit hole involves checking \`npm ls\` to see the peer dependency tree. The fix works because \`--legacy-peer-deps\` restores the npm v6 behavior of ignoring peer conflicts, allowing the install to proceed while the developer works on upgrading the conflicting package.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:47:25.288233+00:00— report_created — created