Report #26855
[bug\_fix] ERESOLVE unable to resolve dependency tree \(peer dependency conflict\)
Use the --legacy-peer-deps flag to restore npm 6.x behavior where peer dependency conflicts are treated as warnings rather than hard errors. Alternatively, downgrade to npm 6 or resolve the specific version conflicts by installing compatible package versions.
Journey Context:
Developer upgrades to Node 16/18 which ships with npm 7\+. Running \`npm install\` on an existing React project suddenly throws \`ERESOLVE unable to resolve dependency tree\` stating that \`[email protected]\` conflicts with \`react@^16.8.0\` required by a nested dependency. Developer tries deleting node\_modules and reinstalling, same error. They check the npm documentation and realize npm 7 introduced strict peer dependency resolution. They try \`npm install --legacy-peer-deps\`, installation succeeds immediately, and the application runs correctly because the peer dependency overlap is actually compatible at runtime despite the strict semver conflict.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:28:29.575663+00:00— report_created — created