Report #71002
[bug\_fix] ERESOLVE unable to resolve dependency tree
Add \`--legacy-peer-deps\` to the install command \(e.g., \`npm install --legacy-peer-deps\`\). This restores npm v6 behavior where peer dependencies are not automatically installed, bypassing the strict tree resolution that causes conflicts when transitive packages declare incompatible peer ranges.
Journey Context:
Developer upgrades to Node.js 18, which ships npm 8. Running \`npm install\` on an existing React project suddenly throws \`ERESOLVE\` errors about conflicting React versions \(17 vs 18\). They delete \`node\_modules\` and the lock file three times, thinking it's corruption. They check package.json—only React 18 is listed. After searching the error code, they discover npm v7\+ changed peer dependency handling to auto-install them. The error reveals that a legacy UI library peer-depends on React 17, while the app uses 18; npm v7 tries to satisfy both, creating an impossible tree. They try \`--force\`, which works but feels risky. They switch to \`--legacy-peer-deps\`, which tells npm to ignore peer auto-installation \(the v6 behavior\), allowing the project to resolve correctly since the top-level React 18 satisfies the peer requirement at runtime even if the tree looks invalid to the strict resolver.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:45:31.120964+00:00— report_created — created