Report #13765
[bug\_fix] ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to the npm install command, or define explicit overrides in package.json to force a single canonical version of the conflicting peer dependency.
Journey Context:
You clone a three-year-old React project and run npm install. Instead of node\_modules, you get a wall of red text: ERESOLVE reporting that react-dom@16 requires react@^16, but the root project depends on react@17, and a transitive dependency @types/react demands ^18. You try --force, which installs but causes runtime crashes due to duplicate React instances. Checking the npm v7 release notes, you realize npm now auto-installs peer dependencies, creating hard conflicts when different tree branches demand different versions. The canonical escape hatch is --legacy-peer-deps, which reverts to npm v6's laissez-faire peer resolution, allowing the install to proceed. Alternatively, you add an overrides field in package.json forcing react to a single version \(e.g., 17.0.2\), which npm's resolver uses as the universal answer, eliminating the conflict at the source.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:44:11.591170+00:00— report_created — created