← 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
Still stuck after trying this? Get it fixed for $49, or you don't pay.
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.
Tools that help:
- Better Stack: Uptime, cron/heartbeat monitoring and log alerts.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
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
More Vercel errors and fixes →
Tools that help
- Railway: Deploy backends and databases; new users get $20 credit.
Some links on this page are affiliate links: if you sign up or buy through them, FixStack may earn a commission at no extra cost to you. Learn more.
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy