Report #10485
[bug\_fix] npm ERR\! code ERESOLVE: dependency tree conflict during install
Root cause: npm v7\+ introduced strict peer dependency resolution that conflicts with legacy nested dependency trees. Fix: Add \`--legacy-peer-deps\` to the install command to temporarily restore npm v6 behavior, OR explicitly install the conflicting peer dependency at the root level with the exact required version, OR upgrade the offending package to a version compatible with the new peer dependency constraints.
Journey Context:
Developer upgrades to Node 16\+ \(npm 7\+\) or clones an old React project. Runs \`npm install\`. Hits \`ERESOLVE could not resolve\` citing a conflict between React 17 and React 18 peer dependencies. Deletes \`node\_modules\` and \`package-lock.json\`, retries, same error. Searches error code, finds GitHub issues explaining npm v7's strict peer deps. Tries \`npm install --legacy-peer-deps\`, which succeeds immediately. Later realizes the proper fix is updating the package.json to resolve the peer conflict explicitly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:48:20.287778+00:00— report_created — created