Report #26289
[bug\_fix] ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to npm install or upgrade conflicting dependencies to compatible versions
Journey Context:
You upgrade to Node.js 16\+ and npm 7\+, then run npm install on an existing project. Suddenly the install fails with ERESOLVE citing peer dependency conflicts. You try deleting node\_modules and package-lock.json but the error persists. You realize npm 7\+ enforces peer dependencies strictly by default \(RFC 0025\), whereas npm 6 ignored conflicts. The rabbit hole involves checking which package is requesting the conflicting peer version, realizing it's a transitive dependency three levels deep. The fix works because --legacy-peer-deps restores npm 6 behavior, allowing the tree to resolve by ignoring peer conflicts, or alternatively you update the root dependency to a version compatible with the peer requirement.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T22:31:54.105660+00:00— report_created — created