ERESOLVE means npm cannot produce a dependency tree that satisfies peer dependency constraints. Read the conflicting packages before forcing install.
Symptoms
- npm install fails with ERESOLVE unable to resolve dependency tree.
- The error mentions peer dependency conflicts.
- A package upgrade breaks installation.
Likely causes
- Package versions require incompatible peer dependencies.
- Lock file and package.json drifted.
- A framework plugin expects a different major version.
Fix steps
- Read the peer dependency lines and identify the incompatible package.
- Upgrade or downgrade the package pair intentionally.
- Avoid --force unless you accept runtime risk.
Verify the fix
- Delete node_modules only after understanding the conflict.
- Run npm install and npm test/build.
- Commit lock file changes intentionally.
FAQ
Should I use --legacy-peer-deps?
Only as a temporary compatibility workaround after reviewing the conflict.
Is deleting package-lock enough?
Not usually. It may hide the version conflict rather than fix it.
Related tools and guides
Last updated: May 18, 2026