Report #59623
[bug\_fix] ERESOLVE could not resolve dependency tree
Run npm install with the --legacy-peer-deps flag to restore npm 6.x behavior where peer dependencies are not automatically installed, or use --force to override the conflict.
Journey Context:
Developer upgrades from Node.js 14/npm 6 to Node.js 18/npm 9. Running npm install on an existing React project suddenly throws ERESOLVE errors citing conflicting peer dependencies for react@17 vs react@18. Deleting node\_modules and package-lock.json does not help. The developer realizes npm 7\+ automatically installs peer dependencies by default, creating impossible version constraints when different packages request incompatible peer versions. Using --legacy-peer-deps prevents npm from auto-installing peer deps, reverting to the npm 6 behavior where the user manually ensures peer dependencies are satisfied, thus resolving the tree conflict.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:34:09.308707+00:00— report_created — created