Report #65432
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to the npm install command, or set legacy-peer-deps=true in .npmrc. This restores npm 6's peer dependency resolution behavior where conflicts were ignored rather than treated as hard errors.
Journey Context:
You upgrade to Node 18 and suddenly npm install fails with ERESOLVE, even though the project worked last month. The error points to a conflict between react@18 in your root package.json and a library expecting react@17 as a peer dependency. You try npm install --force, which works but feels risky. Digging into npm RFC 0025, you realize npm 7\+ treats unresolvable peer conflicts as hard errors. The --legacy-peer-deps flag tells npm to ignore peer dependency conflicts entirely, matching npm 6 behavior, allowing the install to proceed while accepting the risk of runtime errors from mismatched peers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:18:21.359648+00:00— report_created — created