Report #101925
[bug\_fix] npm ERR\! ERESOLVE unable to resolve dependency tree
Run npm install --legacy-peer-deps as a temporary workaround, or permanently fix the conflict by aligning peer-dependency ranges so a single installed version satisfies every package that peer-depends on it. --legacy-peer-deps restores npm 6 peer-dependency enforcement behavior and is safe when you accept the risk of mismatched peers.
Journey Context:
You clone a two-year-old React project and run npm install with npm 9. Instead of installing, npm prints a wall of ERESOLVE output showing [email protected] conflicting with a package that peer-depends on react@^17.0.0. You delete node\_modules and package-lock.json and retry, but the error returns because the conflict is in package.json, not the lockfile. You run npm ls react and see three transitive dependencies requesting incompatible React peer ranges. You consider --force, then realize that silently installs mismatched peers. You either pin a React version compatible with all requesters or pass --legacy-peer-deps to defer enforcement while you migrate. The fix works because npm 7\+ enforces peer dependencies strictly by default; the flag opts the install out of that strict resolution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:40:34.788340+00:00— report_created — created