Report #10126
[bug\_fix] ERESOLVE unable to resolve dependency tree
Pass \`--legacy-peer-deps\` to \`npm install\` to revert to npm 6's peer dependency resolution behavior, or resolve the actual conflict by upgrading/downgrading specific packages to align peer dependency versions. Root cause is npm 7\+'s stricter peer dependency resolution that treats peer conflicts as blocking errors rather than warnings.
Journey Context:
A developer upgrades npm from version 6 to 8 on their React project. Running \`npm install\` suddenly throws \`ERESOLVE unable to resolve dependency tree\`, showing conflicting React versions \(16 vs 18\) required by different transitive dependencies. They delete node\_modules and clear the npm cache, but the error persists. After searching, they learn that npm 7 introduced strict peer dependency resolution \(RFC 0025\). They temporarily resolve it by running \`npm install --legacy-peer-deps\`, allowing the install to complete while they plan to properly upgrade the conflicting dependencies to compatible versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:52:10.617793+00:00— report_created — created