Report #76105
[bug\_fix] npm ERR\! code ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to the install command or set legacy-peer-deps=true in .npmrc to restore npm 6.x peer dependency resolution behavior, allowing conflicting peer versions to coexist without strict resolution.
Journey Context:
You upgrade to npm 7 or 8 and suddenly npm install fails with ERESOLVE, citing a conflict between [email protected] and [email protected] required by different packages. You try --force, which creates an invalid tree that breaks at runtime. Digging into the npm changelog reveals that npm 7\+ uses the Arborist engine which auto-installs peer dependencies by default, turning previous warnings into hard conflicts when versions disagree. The legacy-peer-deps flag tells npm to ignore peer dependency conflicts and not auto-install them, restoring the npm 6 behavior where conflicting peers are left unmet rather than force-resolved.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:19:54.820026+00:00— report_created — created