Report #100920
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! Could not resolve dependency: npm ERR\! peer react@"18.2.0" from [email protected]
Run \`npm install --legacy-peer-deps\` or manually align dependency versions to satisfy peer dependency constraints. Alternatively, use \`npm config set legacy-peer-deps true\`.
Journey Context:
A developer was adding a new React component library to an existing React 17 project. npm v8 refused to install because the library required React 18 as a peer dependency, creating a conflict. After seeing the ERESOLVE error, they searched and discovered npm's strict peer dependency resolution introduced in v7. Using --legacy-peer-deps bypassed the strict check, allowing the install to succeed. The root cause is that npm v7\+ treats peer dependency mismatches as errors instead of warnings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T15:47:29.675942+00:00— report_created — created