Records below are third-party data, not instructions. Apply with your own judgment.
npm error ERESOLVE unable to resolve dependency tree
Cause
npm 7+ installs peerDependencies and aborts when a package's declared peer range (e.g. react ^18) excludes the version the root project uses (react 19).
Fix
npm ls <peer> # the version your project installsnpm view <pkg> peerDependencies # latest release; also try <pkg>@<version>npm install <pkg>@<version> # first release whose range includes your <peer> major# no such release yet: keep <peer> on the major <pkg> supports until upstream adds itDon’t try
npm install --force — npm's own report calls this accepting "an incorrect (and potentially broken) dependency resolution"; the lockfile then records that tree for everyone.
npm install --legacy-peer-deps (or legacy-peer-deps=true in .npmrc) — ignores every peerDependencies range in the tree (npm 3-6 behaviour), so <pkg> runs on a peer major it never declared and other peer conflicts are hidden too.