Report #12199
[bug\_fix] npm ERR\! code ERESOLVE, npm ERR\! ERESOLVE unable to resolve dependency tree while resolving: [email protected], found: [email protected], could not resolve dependency: peer react@"^17.0.0" from [email protected]
Use the --legacy-peer-deps flag with npm install to revert to npm 6's peer dependency resolution behavior, bypassing the strict enforcement introduced in npm 7\+.
Journey Context:
Developer upgrades to Node 18 which bundles npm 9, clones a legacy Create React App project from 2021, runs npm install, and is blocked by ERESOLVE citing a conflict between React 18 and react-scripts expecting React 17. They delete node\_modules and package-lock.json multiple times to no avail, check the npm docs and discover npm 7 changed peer dependency handling to strict by default, realize the "fix" is not changing code but using --legacy-peer-deps flag to restore the old behavior, installation proceeds successfully.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:18:38.368825+00:00— report_created — created