# npm: ERESOLVE unable to resolve dependency tree — Found: react@19.0.0 / Could not resolve dependency: peer react@"^18.2.0" from some-lib

**Code:** `ERESOLVE: next requires react ^18 (peer dependency conflict)` · **Category:** Next.js · **Seen on:** Next.js, npm, React

A package requires a React version different from the one installed with Next.js.

## Meaning

Next.js 15 uses React 19; libraries pinned to React 18 may not declare support yet. Upgrade the library, install a compatible version, use `--legacy-peer-deps` or `overrides` as a temporary workaround (test thoroughly). Check the library's release notes for React 19 support.

## Common causes

- Library peerDependency limited to React 18
- Next.js/React upgrade without checking dependencies
- Mixed versions across workspaces
- Lockfile from different versions
- Beta/RC peer ranges

## Quick fix

1. Upgrade the conflicting package
2. `npm install --legacy-peer-deps` (temporary)
3. Use `overrides` in package.json after verifying compatibility

## Detailed fix by platform

### Linux

1. `npm ls react` and `npm explain react`

## How to diagnose

1. **Peer** — Required range?
2. **Library** — Newer version?
3. **Workaround** — Overrides?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/nextjs/peer-dependency-react-version-conflict)
