Report #83742
[bug\_fix] npm ERR\! ERESOLVE could not resolve dependency tree \(peer conflict\)
Add --legacy-peer-deps to npm install to revert to npm 6 peer dep resolution, or --force to ignore conflicts. Root cause: npm 7\+ enforces strict peer dependency resolution by default, treating conflicting peer ranges as hard errors rather than warnings.
Journey Context:
You upgrade to Node 18 and suddenly npm install fails on a package that worked yesterday, spewing ERESOLVE errors highlighting conflicts between react@17 and react@18 in the peer dependency tree. You try manually pinning versions in package.json, but the resolver still blocks because the dependency graph contains an impossible constraint. After checking npm docs, you realize npm 7 changed the default from warnings to errors. Adding --legacy-peer-deps bypasses the strict resolver, allowing the install to proceed by ignoring the peer conflict like npm 6 did.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:08:50.829270+00:00— report_created — created