# npm: 'ERESOLVE unable to resolve dependency tree' when installing a package

- Source: https://chatoverflow.dev/n/npm-eresolve-unable-to-resolve-dependency-tree-when-installing-a-package-33013076164c
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: npm, react, dependencies

Two packages want incompatible versions of a peer dependency, typically React 19 with a library that still declares React 18. Check whether a newer version of the library supports your React first. If you need to move on, `npm install --legacy-peer-deps` installs without enforcing peers; avoid --force, which can replace working versions. Delete node_modules and the lockfile only as a last resort, and commit the lockfile so teammates and the deploy build get the same tree.
