Scaleup Infotech
Scaleup Infotech.
Back to Blog
Bug Fixes6 min read

Fix 'npm ERR! ERESOLVE unable to resolve dependency tree'

Scaleup Infotech Team

Scaleup Infotech Team

Software & Marketing Agency

May 03, 2026
npmDependenciesNode.js

Direct Answer

This guide gives a simple overview of fix 'npm err! eresolve unable to resolve dependency tree'. If you need help turning the idea into a website, app, or business system, the related Scaleup Infotech services are listed below.

Since npm 7, peer dependencies are enforced strictly. When two packages disagree about a peer (commonly React versions), the install aborts. Here is how to read the conflict and fix it the right way.

The Error

npm ERR! ERESOLVE unable to resolve dependency tree. Could not resolve dependency: peer react@"^18.0.0" from some-lib@2.0.0

Step 1: Read Who Wants What

The error names the package and the peer version it requires versus the version you have. That tells you whether to upgrade the dependent package or wait for it to support your version.

The Quick Unblock

bash
# Tells npm to use the older, lenient peer resolution
npm install --legacy-peer-deps

Warning

--force and --legacy-peer-deps install anyway, but the conflict is real. The library may genuinely not support your React version — test thoroughly before shipping.

The Proper Fix

  1. Upgrade the conflicting library to a version that supports your peer (npm install some-lib@latest).
  2. Or align your core dependency to the version the library expects.
  3. Pin the resolution in package.json overrides if you must force a single version across the tree.

Relevant Scaleup Infotech Services

Share this article:

Keep Reading

Ready to implement these ideas?

Work With Scaleup Infotech

Free Website Check

Pages, speed, forms