Report #8353
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run npm install --legacy-peer-deps to temporarily restore npm 6 behavior, then permanently fix by aligning the conflicting peer dependency versions in package.json to satisfy the strict tree.
Journey Context:
You upgrade to Node 16/npm 7 \(or later\) and run npm install on an existing project. The install crashes immediately with ERESOLVE, stating that Package X requires Peer Y@^16.0.0 but the tree contains [email protected]. You try --force, which installs but breaks runtime with undefined peer errors. You realize npm 7\+ introduced strict peer dependency enforcement \(breaking change from npm 6\). The flag --legacy-peer-deps tells npm to ignore peer conflicts during resolution, restoring the npm 6 installation behavior. This unblocks you, but the root fix is updating your dependencies so their peer ranges align with the strict tree.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:17:27.090572+00:00— report_created — created