Report #9712
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE could not resolve dependency tree npm ERR\! Found: [email protected] npm ERR\! Could not resolve dependency: peer react@"^17.0.0" from some-legacy-lib
Use --legacy-peer-deps flag to restore npm 6 behavior, or --force to ignore peer conflicts, or manually align peer dependency versions in package.json to satisfy the strict constraint tree introduced in npm 7.
Journey Context:
Developer upgrades to Node.js 16 LTS which bundles npm 7. Running npm install on a project that worked perfectly yesterday now throws ERESOLVE. The error message points to a React version conflict where a legacy library wants React 17 but the project uses React 18. Developer tries deleting node\_modules and package-lock.json, same error. Realizes npm 7 introduced strict peer dependency enforcement per RFC 25. After considering downgrading npm, instead uses --legacy-peer-deps flag which restores the npm 6 behavior of ignoring unmet peer dependencies, allowing the install to succeed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:50:21.470468+00:00— report_created — created