npm error code ERESOLVE — unable to resolve dependency tree
npm, Node.js
npm error code ERESOLVE / unable to resolve dependency tree / peer dependency conflict.
What it means (root cause)
Two packages demand conflicting versions of the same peer dependency, and npm's strict resolver refuses to pick one. Common after a major framework upgrade.
The symptom developers actually see: npm error code ERESOLVE / unable to resolve dependency tree / peer dependency conflict.
Step-by-step fix
Concrete, ordered steps from the dataset. Apply them in order; each line is a verified action, not generic advice.
- 1Read the conflicting peer-dep names/versions npm printed; align them in package.json.
- 2As a stopgap: npm install --legacy-peer-deps (loosens peer resolution, not a real fix).
- 3Pin/upgrade the offending package to a version whose peer range matches your other deps.
Where this error appears
Languages, frameworks, and runtimes where this error is observed (from the 2026 DevFixPro error dataset, retrieved 2026-08-29):
npm v7+ (peer deps installed strictly). Classic with React/Angular major bumps.
How to prevent it & common questions
Practical prevention plus the questions developers ask most about this error.
What does "npm error code ERESOLVE — unable to resolve dependency tree" mean?
Two packages demand conflicting versions of the same peer dependency, and npm's strict resolver refuses to pick one. Common after a major framework upgrade.
Which environments are affected by npm error code ERESOLVE — unable to resolve dependency tree?
npm, Node.js
How do I fix npm error code ERESOLVE — unable to resolve dependency tree?
Read the conflicting peer-dep names/versions npm printed; align them in package.json. As a stopgap: npm install --legacy-peer-deps (loosens peer resolution, not a real fix). Pin/upgrade the offending package to a version whose peer range matches your other deps.
How do I prevent npm error code ERESOLVE — unable to resolve dependency tree?
Upgrade one major framework at a time and update peers together; use npm ls <pkg> to see the conflict tree.
Is --legacy-peer-deps a real fix?
No — it loosens resolution so install succeeds, but the conflict remains. Prefer aligning the peer versions in package.json.
How do I see what conflicts?
Run npm ls <peer-package> to print the dependency tree; npm prints the exact versions each package wants.
Related DevFixPro tools
Real, browser-only utilities on DevFixPro that help while you work through this issue. These are navigation aids, not a substitute for the fix above.
Sources & attribution
- Error records aggregated from Google Search Console query gaps (2026-05-21~2026-08-18) for devfixpro.com, plus official framework docs (MDN, Node.js docs, Python docs, Go.dev, Rust book, Oracle Java docs, Docker docs, npm docs). Source dataset retrieved 2026-08-29. License: CC BY 4.0 — attribute DevFixPro (devfixpro.com).
- Official reference: https://docs.npmjs.com/cli/v10/using-npm/dependency-resolution
- All cause, environment, fix and prevention text on this page is taken verbatim from the DevFixPro 2026 error dataset. DevFixPro does not invent root causes or fixes.
How this npm error code ERESOLVE — unable to resolve dependency tree page is built
Each error page is generated from a single record in the DevFixPro 2026 error dataset. The meaning, root cause, environments, fix steps, prevention, and official references are copied verbatim from that dataset and its official-doc sources; related-error links are computed from the error's category and explicit peer list. No root cause or fix is invented. The retrieval date for this dataset is 2026-08-29.