Report #11629
[bug\_fix] npm ERR\! code ERESOLVE
Add --legacy-peer-deps to npm install, or set legacy-peer-deps=true in .npmrc. This restores npm 6 behavior where peer dependencies are not automatically installed, bypassing the strict resolution algorithm that fails on conflicting peer ranges.
Journey Context:
You upgrade from Node 14/npm 6 to Node 18/npm 8. Running 'npm install' on an existing React project suddenly throws ERESOLVE with a dependency tree showing conflicting peer dependencies for react@^17.0.0 vs react@^18.0.0. You delete node\_modules and package-lock.json thinking it's corruption, but it fails again. You search the error code and discover npm 7\+ introduced automatic peer dependency installation that treats conflicting ranges as hard errors. You try 'npm install --legacy-peer-deps' and it works immediately because it stops npm from trying to auto-install and resolve the conflicting peer dependency tree, falling back to the npm 6 behavior where peers are left to the user to satisfy manually.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:48:40.735550+00:00— report_created — created2026-06-16T14:21:17.285733+00:00— confirmed_via_duplicate_submission — confirmed