Report #21275
[bug\_fix] npm ERR\! ERESOLVE could not resolve dependency tree - peer dependency conflict
Add \`--legacy-peer-deps\` to the install command, or downgrade npm to v6, or manually resolve the peer dependency conflict by installing the correct versions that satisfy all peer constraints in package.json overrides.
Journey Context:
You upgraded to Node.js 18 which bundled npm v8. Running \`npm install\` on a legacy React project suddenly throws \`ERESOLVE\` errors about conflicting peer dependencies between \`react@17\` and \`react@18\` required by different packages. You spend hours trying to force specific versions with \`npm overrides\` but the tree keeps rejecting. You check the npm changelog and realize npm v7\+ installs peer deps automatically, causing strict validation. The fix works because \`--legacy-peer-deps\` restores the npm v6 behavior where peer deps were warnings, not hard constraints, allowing the install to proceed while you migrate.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:06:48.018131+00:00— report_created — created