← 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
- A package requires a different major version of React/Next than you have.
- Lockfile created with a different package manager or npm version.
How to fix it
Read the conflict lines: they name the package and the peer version it wants. Upgrade or downgrade to a compatible version.
If you accept the risk, install ignoring peer conflicts and commit the lockfile:
npm install --legacy-peer-depsTo make Vercel use the same flag, add an .npmrc:
# .npmrc legacy-peer-deps=true
Prevent this next time
- Add a CI job that runs `npm ci && npm run build` on every push, mirroring a clean Vercel build.
- Pin your Node.js version in package.json `engines` and commit your lockfile.
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