← All errors · VercelVercel build & deploy errors

npm ERR! ERESOLVE unable to resolve dependency tree

Exact error

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

What it means

npm (v7+) found conflicting peer dependency requirements and refuses to install.

Likely causes

How to fix it

  1. Read the conflict lines: they name the package and the peer version it wants. Upgrade or downgrade to a compatible version.

  2. If you accept the risk, install ignoring peer conflicts and commit the lockfile:

    npm install --legacy-peer-deps
  3. To make Vercel use the same flag, add an .npmrc:

    # .npmrc
    legacy-peer-deps=true

Prevent this next time

Guide: catch outages before your users do.

FAQ

What does "npm ERR! ERESOLVE unable to resolve dependency tree" mean?

npm (v7+) found conflicting peer dependency requirements and refuses to install.

What usually causes it?

A package requires a different major version of React/Next than you have. Lockfile created with a different package manager or npm version.

How do I fix it?

1. Read the conflict lines: they name the package and the peer version it wants. Upgrade or downgrade to a compatible version. 2. If you accept the risk, install ignoring peer conflicts and commit the lockfile: 3. To make Vercel use the same flag, add an .npmrc:

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy