Report #7105
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run install with --legacy-peer-deps to restore npm v6 peer dependency behavior, or --force to ignore conflicts. Root cause: npm v7\+ automatically installs peer dependencies and performs strict validation of the entire tree; conflicting version ranges that were warnings in v6 now hard-fail.
Journey Context:
Developer upgrades to Node 18/20 \(bundling npm 9\+\) or clones a legacy React project. Runs npm install. Sees ERESOLVE with a cryptic tree showing 'conflicting peer dependency: react@^17.0.0'. Deletes node\_modules and package-lock.json, retries, same error. Checks StackOverflow and finds the npm v7 changelog. Realizes a transitive ESLint plugin wants React 17 while the project uses React 18. Considers downgrading React but that breaks the UI library. Discovers --legacy-peer-deps flag, runs npm install --legacy-peer-deps, install succeeds. Understands that this flag restores v6's lenient peer dep handling, accepting the runtime risk of version mismatches rather than failing the install.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:47:41.386776+00:00— report_created — created