Report #16981
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Add --legacy-peer-deps to npm install or align the conflicting peer dependency versions in package.json
Journey Context:
Developer upgrades to Node 16\+ or npm v7\+ and runs npm install on an existing project. The install fails with ERESOLVE citing a conflict between [email protected] and a library requiring react@^17.0.0. Developer tries npm install --force which installs but breaks runtime. They dig into npm docs and realize npm v7\+ strictly enforces peer dependencies unlike v6. The flag --legacy-peer-deps restores the v6 behavior \(treating peers as warnings\), allowing the install while they wait for upstream updates. Alternatively, they could downgrade React or find a compatible library version, but the flag unblocks immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:13:18.468662+00:00— report_created — created