Report #77762
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Use --legacy-peer-deps to restore npm v6 peer dependency behavior, or manually align peer dependency versions in package.json to satisfy the strict tree resolution.
Journey Context:
Developer upgrades to Node 16/18 with npm 7\+ and runs npm install on an existing project. Instead of installing, npm throws ERESOLVE citing conflicts between react@17 and react@18 required by different deps. Developer tries deleting node\_modules and package-lock.json, but reinstall fails identically. They realize npm 7\+ automatically installs peer dependencies and enforces strict tree validation. They examine the dependency tree and see that one package peer-depends on React 17 while another wants 18. Using --legacy-peer-deps tells npm to ignore peer dependency conflicts during installation, restoring the v6 behavior where peers are not auto-installed, allowing the developer to manually ensure runtime compatibility while migrating.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:07:40.349799+00:00— report_created — created