How to Fix npm ERESOLVE Unable to Resolve Dependency Tree
On this page
The npm error ERESOLVE unable to resolve dependency tree usually means npm found incompatible package or peer-dependency requirements. Read the error to identify which packages disagree instead of blindly forcing the install.

1. Read the conflict in the terminal
Look for Found: and Could not resolve dependency:. npm often names the installed version and the peer version another package expects. These lines reveal the mismatch.
2. Check Node.js and npm versions
node --version
npm --version
Confirm your project supports those versions. If you recently upgraded Node.js or npm, check the project’s README and CI configuration.
3. Inspect the package’s peer requirements
npm view PACKAGE_NAME versions
npm view PACKAGE_NAME peerDependencies
Replace PACKAGE_NAME with the package named in the error. If a maintained release supports your framework version, update that package and retry using your project’s normal package manager.
4. Align framework versions
For React, Angular, Vue, TypeScript, or build-tool conflicts, check the supported ranges on both sides. Upgrade an outdated plugin or select a compatible framework version. Change one dependency at a time and rerun the install.
5. Use –legacy-peer-deps only as a temporary workaround
npm install --legacy-peer-deps
This tells npm to ignore peer-dependency conflicts during resolution. It may unblock development, but it does not prove the installed combination works. Run your tests and build, document the workaround, and plan to fix the mismatch.

6. Avoid –force as your first fix
npm install --force overrides more safeguards and can leave an install that fails at runtime. Prefer compatible package versions. If you use a force flag during an emergency, review the changes and test the application.
7. Use the lockfile carefully
If the lockfile is committed and valid, use the project’s documented clean-install command, often:
npm ci
npm ci expects the lockfile and package manifest to agree. Do not delete package-lock.json reflexively: it records resolved versions and helps keep builds reproducible. If you intentionally change dependencies, update and review the lockfile.
8. Consider overrides carefully
The overrides field in package.json can pin a transitive dependency in supported npm versions. Use it only after checking compatibility; an override can hide a mismatch without solving a runtime problem.
FAQs
Why did npm start showing ERESOLVE?
Modern npm versions enforce peer-dependency compatibility more strictly. A package update or newer framework version may expose a conflict that older tooling ignored.
Is –legacy-peer-deps safe?
It is a workaround, not a guarantee. Use it only when you understand the conflict and can test the application.
Should I delete node_modules and package-lock.json?
Not automatically. Read the error first and preserve the lockfile unless you deliberately intend to regenerate dependency resolution.
Official references: npm install documentation and npm package.json overrides.
