Report #55592
[bug\_fix] npm ERR\! ERESOLVE could not resolve dependency tree - Conflicting peer dependencies
Use --legacy-peer-deps to revert to npm v6 peer dependency resolution algorithm, or manually resolve version conflicts in package.json to satisfy peer dependency constraints explicitly.
Journey Context:
Developer upgrades to npm 7\+ and runs npm install on an existing React project. The install fails with ERESOLVE, indicating that React 17 is requested but a dependency expects React 18. Developer tries --force, which installs successfully but causes runtime crashes due to conflicting React instances. After digging into npm RFC 25 and the Arborist documentation, they realize npm 7 automatically installs peer dependencies, causing version conflicts. Using --legacy-peer-deps restores the npm v6 behavior where peer deps are not auto-installed, allowing the existing resolution algorithm to work without forcing incompatible versions together.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:48:23.974783+00:00— report_created — created