Report #45973
[bug\_fix] ERESOLVE unable to resolve dependency tree - Conflicting peer dependencies
Add --legacy-peer-deps to npm install to restore npm 6.x behavior \(auto-installing peer deps without strict conflict checking\), or align the dependency tree so only one version of each peer is required
Journey Context:
A developer upgrades from Node.js 14/npm 6 to Node.js 18/npm 8 and runs npm install on an existing React project. The install immediately fails with ERESOLVE, showing that package A requires react@17 while package B requires react@18 as peer dependencies. The developer tries deleting node\_modules and the lockfile, but the error persists because npm 7\+ automatically installs peer dependencies and enforces that only one version can exist at the root. After searching GitHub issues, they realize npm changed its peer dependency resolution strategy in v7. The developer either uses --legacy-peer-deps to disable the new strict peer dependency auto-installation behavior, or manually upgrades packages to align on a single React version, allowing the install to succeed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:38:34.656975+00:00— report_created — created