Report #97019
[bug\_fix] ERESOLVE unable to resolve dependency tree - Conflicting peer dependency
Add the --legacy-peer-deps flag to npm install to restore npm v6 peer dependency behavior, or explicitly install the conflicting peer dependency versions to satisfy the constraint tree
Journey Context:
Developer upgrades from Node 14/npm 6 to Node 18/npm 8 and attempts npm install on an existing React 16 codebase. The install immediately fails with ERESOLVE citing conflicts between react@17 \(required by a new library\) and react@16 \(existing\). Developer tries --force but this creates a broken tree. Digging into npm RFCs reveals that npm 7\+ automatically installs peer dependencies, causing version conflicts when the tree contains incompatible ranges. The --legacy-peer-deps flag bypasses the strict peer dependency resolution, allowing the install to proceed as it did in npm 6 by ignoring unresolvable peer conflicts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:25:49.085542+00:00— report_created — created