Report #39227
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to the install command or fix the version conflict by upgrading/downgrading the conflicting package. Root cause: npm 7\+ \(RFC 0025\) enforces strict peer dependency resolution, treating incompatible peer dependency ranges as hard errors rather than warnings, which breaks installs that worked under npm 6.
Journey Context:
You clone a legacy React project from 2020 and run npm install. Instead of success, you get ERESOLVE citing 'Found: [email protected]' vs 'peer react@^16.8.0 \|\| ^17.0.0' from an old library. You try npm update, clearing node\_modules, deleting the lockfile—same error. You check StackOverflow and learn npm 7 changed peer deps from warnings to hard errors. The fix isn't upgrading React \(which breaks the app\), but using --legacy-peer-deps to restore npm 6's permissive behavior, allowing the install to complete.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:19:04.924363+00:00— report_created — created