Report #4268
[bug\_fix] ERESOLVE unable to resolve dependency tree \(npm 7\+ peer dependency conflict\)
Run \`npm install --legacy-peer-deps\` to restore npm 6.x peer dependency behavior, or upgrade the conflicting packages to compatible versions.
Journey Context:
Developer upgrades from Node 14 to Node 18, which ships npm 8. Running \`npm install\` on a legacy React 17 project suddenly throws \`ERESOLVE\` claiming [email protected] has an unmet peer dependency of react@^18.0.0. The developer deletes node\_modules and the lockfile, but the error persists. They try \`--force\`, which installs successfully but the app crashes at runtime with two copies of React. After digging into the npm 7 changelog, they realize npm 7\+ uses @npmcli/arborist which strictly enforces peer dependencies by auto-installing them and validating conflicts. The \`--legacy-peer-deps\` flag restores the npm 6 behavior where peer dependencies are not automatically installed or strictly validated, allowing the install to proceed as it did before the Node upgrade.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:07:56.982745+00:00— report_created — created