Report #83553
[bug\_fix] npm ERR\! code ERESOLVE... could not resolve dependency
Run the install command with \`--legacy-peer-deps\` \(e.g., \`npm install --legacy-peer-deps\`\) to restore npm 6's peer dependency handling, or resolve the actual version conflict by aligning the conflicting peer dependency versions in your package.json.
Journey Context:
You just upgraded to Node.js 16\+ which ships npm 7\+, or cloned a legacy React project. Running \`npm install\` halts with ERESOLVE citing peer dependency conflicts \(e.g., React 17 vs 18\). You panic and delete node\_modules and package-lock.json, but the error persists. You waste time checking if the registry is down. Eventually, you realize npm 7\+ automatically installs peer dependencies and strictly validates them, unlike npm 6 which ignored conflicts. The error isn't corruption; it's a legitimate version conflict the package manager is now enforcing. Using \`--legacy-peer-deps\` tells npm to ignore peer dependency conflicts and install anyway, matching the old behavior that worked.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:49:44.957804+00:00— report_created — created