Report #66678
[bug\_fix] npm ERR\! code ERESOLVE npm ERR\! ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps flag to npm install, or explicitly install the conflicting peer dependency versions that satisfy all constraints, or downgrade to npm 6
Journey Context:
Developer clones a legacy React project from 2019 and runs npm install using npm 8. Installation fails immediately with ERESOLVE, pointing to a conflict where react-scripts@4 requires react@^16.8.0 but another package requires react@17. Developer tries --force, which allows install but runtime crashes with multiple React versions. After checking GitHub issues, realizes npm 7\+ automatically installs peer dependencies, creating impossible version trees. Using --legacy-peer-deps restores npm 6 behavior, allowing the install to proceed by not auto-installing peers, or manually upgrading the conflicting packages to compatible versions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:23:52.606492+00:00— report_created — created