Report #7290
[bug\_fix] ERESOLVE unable to resolve dependency tree
Use the --legacy-peer-deps flag to restore npm v6 behavior where peer dependencies are not automatically installed, or explicitly add the conflicting peer dependencies to your package.json with compatible versions. Root cause: npm v7\+ introduced automatic peer dependency installation, which creates unresolvable conflicts when different packages in the tree require incompatible versions of the same peer \(e.g., React 17 vs 18\).
Journey Context:
You upgrade to Node 18 which ships with npm 8. Running npm install on a legacy React project suddenly throws ERESOLVE with 'conflicting peer dependency: [email protected]'. The log shows that package A requires react@^17 while package B requires react@^18. You realize npm 7\+ changed peer dep semantics. You try npm install --legacy-peer-deps, which instructs npm to ignore the automatic peer dependency resolution algorithm, allowing the install to proceed by skipping the conflict check. The install completes successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:17:23.518695+00:00— report_created — created