Web build

npm ERESOLVE unable to resolve dependency tree

Conflicting package versions

npm ERESOLVE unable to resolve dependency tree. Two packages need incompatible versions of a shared dependency (often React or Vite), so npm refuses to install.

Updated

What this error means

Two packages need incompatible versions of a shared dependency (often React or Vite), so npm refuses to install.

Why it happens

npm’s peer-dependency check found two packages that require different versions of the same dependency, and it will not pick one on its own.

The message tools print

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree

How to fix it

  1. Read the lines below the error: they name the two packages that disagree.
  2. Update the older one, or pin versions that work together.
  3. As a stopgap, npm install --legacy-peer-deps, then commit the lockfile.

Check a log that shows this

Paste the failing step into the build error explainer. It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

Other Web build errors

Build the web app before the native one

CapWrapp installs dependencies from the lockfile, builds the site, and runs Capacitor sync before the native build, from the GitHub repo you connect.

  • Free to start
  • No credit card
  • Sign in with Google or GitHub