npm ERESOLVE: unable to resolve dependency tree. What does it mean?

Also searched as: npm ERR! code ERESOLVE · npm ERR ERESOLVE could not resolve · ERESOLVE unable to resolve dependency tree · npm install ERESOLVE overriding peer dependency · npm error code ERESOLVE React

Updated 3 October 2026

Short answer

Two of your packages disagree about which version of a shared package they need, usually React, Angular or a similar framework. Modern npm refuses to install a combination that breaks a package's stated requirements, where npm 6 and earlier ignored the problem. The quick way past it is --legacy-peer-deps, which tells npm to ignore those requirements again, and npm's own documentation doesn't recommend it. The real fix is to update the package that's out of step, or replace it.

What's the problem

npm install stops with "ERESOLVE unable to resolve dependency tree", followed by lines like "Found: react@18" and "Could not resolve dependency: peer react@^16 from some-package". The project may have installed fine years ago, or for the previous developer.

Why it happens

  • Plugins declare what they work with. A package that plugs into React or Angular lists which versions it supports, its "peer dependencies".
  • Your project moved and the plugin didn't. React was upgraded, but one plugin still says it only supports an older React. Often it's been abandoned.
  • npm got stricter. npm versions 3 to 6 ignored peer dependency conflicts. Newer npm stops and tells you, which is why an old project that "always installed" suddenly doesn't.

How to fix it

  1. Read the error. The package after "from" (in "peer react@^16 from some-package") is the one out of step. "Found" shows what you actually have.
  2. Look for a newer version of that package that supports your framework version, and update it.
  3. If it's abandoned, find a maintained replacement, or remove it if you don't really need it.
  4. Repeat until npm install succeeds without extra flags, then commit the lockfile.
  5. Use --legacy-peer-deps only as a temporary bridge to get the project running so you can test, not as the fix. It installs combinations their authors say won't work, so test carefully if you use it.

When to call Preventionlabs

One or two out-of-step packages are a quick fix. Call us when the conflicts chain: updating one package forces a framework upgrade, which breaks three others, which have no maintained replacements. A resurrection delivers an app that builds and starts on maintained dependencies, with the conflicts actually resolved rather than switched off.

Submit your project for a free assessment

Free assessment. $10,000 AUD flat to get it live, only if we take it on and you go ahead.

Sources

  1. npm: Config: legacy-peer-depsofficial docsCauses npm to completely ignore peerDependencies when building a package tree, as in npm versions 3 through 6.
  2. npm: Config: legacy-peer-depsofficial docsUse of legacy-peer-deps is not recommended, as it will not enforce the peerDependencies contract that meta-dependencies may rely on.
← All of It used to work