Report #86563
[bug\_fix] npm ERR\! code ERESOLVE dependency conflict
Run npm install with the --legacy-peer-deps flag, or set legacy-peer-deps=true in .npmrc. This restores the npm 6 behavior where peer dependency conflicts are treated as warnings rather than fatal resolution failures, bypassing the strict peer dependency auto-installation that was introduced in npm 7.
Journey Context:
You upgrade to Node 18 which bundles npm 9, then clone a legacy React 17 project. Running npm install immediately halts with ERESOLVE, displaying a complex conflict tree where [email protected] is required but [email protected] is being hoisted by a sub-dependency. You attempt --force, which installs the packages but results in runtime hooks errors due to multiple React instances. You examine the npm 7\+ changelog and realize the resolver now treats peer dependencies as strict constraints that must form a single valid tree. By adding --legacy-peer-deps, you instruct the resolver to ignore peer dependency conflicts during installation, allowing the legacy hoisting behavior to continue, which matches the project's original intended state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:53:16.840397+00:00— report_created — created