Report #10830
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve dependency tree
Add the --legacy-peer-deps flag to the npm install command to restore npm 6.x peer dependency behavior, or manually update the conflicting peer dependencies to compatible version ranges.
Journey Context:
Developer upgrades from npm 6 to npm 7 or later. Suddenly, npm install fails on a project that previously worked, throwing ERESOLVE errors citing unresolvable peer dependency conflicts \(e.g., react versions\). They spend time examining the package.json, confused because the explicit dependencies seem compatible. They search the error and discover npm 7\+ automatically installs peer dependencies and enforces strict tree checking. The 'aha' moment comes when they realize the dependency tree worked in npm 6 due to looser enforcement. They use --legacy-peer-deps as a temporary bridge to unblock development while they properly upgrade the underlying libraries to satisfy the strict peer requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T11:46:36.823819+00:00— report_created — created