Report #84833
[bug\_fix] npm ERR\! code ERESOLVE
Add --legacy-peer-deps to npm install/ci. This restores npm v6 behavior, allowing installation despite peer dependency version conflicts that are unsatisfiable under npm 7\+'s strict peer resolution algorithm.
Journey Context:
You upgrade your CI to Node 18, which ships npm 8. Running npm ci on your legacy React 16 project suddenly throws ERESOLVE with a peer conflict between react@16 and react@17 demanded by some transitive dev dependency. You delete package-lock.json and node\_modules, trying to let npm rebuild the tree from scratch, but the error persists because the fundamental peer requirement is unsatisfiable under npm 7\+ strict resolution. You try --force, which installs anyway but warns that the tree is broken. Finally, you discover --legacy-peer-deps, which tells npm to ignore peer conflict contradictions and install as npm v6 would, acknowledging that your legacy project cannot satisfy the peer requirements without major upgrades. This works because it restores the pre-npm-7 peer dep resolution algorithm.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T00:58:50.983237+00:00— report_created — created