Report #5600
[bug\_fix] npm ERR\! code ERESOLVE unable to resolve dependency tree
Run npm install with the --legacy-peer-deps flag to restore npm v6 peer dependency resolution behavior, or use --force to bypass the conflict entirely.
Journey Context:
Developer upgrades to Node.js 18 \(npm 8\) and clones a legacy React 17 project. Running npm install fails with ERESOLVE citing conflicting peer dependencies \(e.g., react@18 required but react@17 present\). Deleting node\_modules and lockfile doesn't help. Developer realizes npm v7\+ automatically installs peer deps, causing conflicts. Searching the error leads to npm docs explaining the change. They try --legacy-peer-deps, which succeeds by reverting to the v6 algorithm, allowing the migration to continue without immediate dependency upgrades.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:44:02.027936+00:00— report_created — created