Report #68343
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to the install command \(npm install --legacy-peer-deps\) to restore npm 6.x peer dependency behavior, or manually align the conflicting peer dependency versions in package.json.
Journey Context:
Developer upgrades to Node 16 or 18, which ships npm 7\+, and suddenly npm install fails on a project that worked yesterday. The error log shows a conflict between react@18 and a plugin requiring react@^17. Developer tries deleting node\_modules and package-lock.json repeatedly, but the install still fails. They realize npm 7 introduced strict peer dependency resolution that treats peer conflicts as errors rather than warnings. By adding --legacy-peer-deps, npm ignores peer dependency conflicts during installation, allowing the tree to resolve exactly as it did under npm 6, buying time to properly upgrade the conflicting packages later.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:12:04.589983+00:00— report_created — created