Report #76966
[bug\_fix] ERESOLVE unable to resolve dependency tree \(npm 7\+ peer dependency conflicts\)
Add --legacy-peer-deps flag to npm install or set legacy-peer-deps=true in .npmrc to revert to npm 6 behavior where peer dependencies are not automatically installed.
Journey Context:
Developer upgrades from Node 14 to Node 18, bringing npm 6 to npm 8. Running npm install on an existing React 17 project suddenly throws ERESOLVE with a massive tree showing conflicting peer dependencies for react@17 vs react@18. Developer tries npm install --force which works but feels dangerous. Digging into npm changelogs reveals npm 7\+ auto-installs peer dependencies, causing conflicts when transitive dependencies request incompatible ranges. Realizing --legacy-peer-deps disables this auto-installation, matching the old behavior where peer deps were warnings not hard blocks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:47:10.094084+00:00— report_created — created