Report #43075
[bug\_fix] npm ERR\! code ERESOLVE unable to resolve dependency tree peer conflict
Add --legacy-peer-deps flag to restore npm v6 lenient peer dependency behavior, or manually resolve the version conflict by upgrading/downgrading packages to compatible peer ranges.
Journey Context:
You upgrade npm from v6 to v8 and suddenly npm install fails with ERESOLVE even though it worked yesterday. The error log shows a peer dependency conflict where PackageA wants React 16 and PackageB wants React 18. You spend an hour downgrading packages randomly before realizing npm v7\+ automatically installs peer dependencies and strictly enforces them, unlike v6 which ignored conflicts. You either add --legacy-peer-deps to restore the v6 non-strict behavior, or manually resolve the version conflict by upgrading/downgrading the dependent packages to compatible versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:46:36.726260+00:00— report_created — created