Report #78017
[bug\_fix] ERESOLVE: could not resolve dependency tree due to conflicting peerDependencies
Run npm install with --legacy-peer-deps flag, or upgrade the conflicting dependency to a version compatible with the peer dependency range. Root cause: npm 7\+ uses Arborist which strictly enforces peer dependency resolution unlike npm 6, treating peer dependency conflicts as hard errors rather than warnings.
Journey Context:
You upgrade Node.js which bundles npm 8\+, then run npm install on an existing React 16 project. Suddenly you see ERESOLVE errors indicating that react@16 conflicts with react@18 required by some sub-dependency's peerDep. You try deleting node\_modules and package-lock.json but the error persists. You search the error code and find npm changed peer dep handling in v7. You realize --legacy-peer-deps restores the npm 6 behavior of ignoring unmet peer deps, allowing the install to complete while the runtime still works because the project actually provides React 16.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:32:50.041527+00:00— report_created — created