Skip to content
Nilay Kabariya

Entry No.006·Fixes·Updated ·3 min read

Fix: npm ERESOLVE unable to resolve dependency tree (React 19)

npm ERESOLVE with React 19 or ESLint 10, on npm 11 and 12. Four fixes compared, and why --legacy-peer-deps breaks the next npm ci.

by Nilay#npm#react#dependencies#eslintFIXED

The error, verbatim

Jump to the fix ↓
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error Found: react@19.3.0
npm error Could not resolve dependency:
npm error peer react@"^16.8.5 || ^17.0.0 || ^18.0.0" from react-beautiful-dnd@13.1.1
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
✓ Reproduced on Windows 11 Pro; Ubuntu on GitHub Actions

Tested on

npm / Node
11.9.0 / 24.14.0; 11.19.1 and 12.2.1 / 24.22.1 (November 1)
react
19.3.0, 19.3.1
Conflicts
react-beautiful-dnd 13.1.1; eslint-plugin-react 7.37.5 with ESLint 10.14.0
OS
Windows 11 Pro; Ubuntu on GitHub Actions

✓ Last re-run on GitHub Actions · see the run · all repros

Contents
  1. The fix01
  2. The same error with ESLint 1002
  3. Who wants which version?03
  4. What didn’t work04
  5. Why it happens05
  6. How this was tested06

Since npm 7, npm treats a peer dependency that doesn’t match as an error. You get this when one package says it only works with older versions of something you have newer. On November 1, 2026 I re-ran it on npm 11.19.1 and npm 12.2.1: the same error, word for word, so npm 12 didn’t relax anything. The two conflicts I hit most right now:

  • React 19 with a package that lists only React 16–18 (here react-beautiful-dnd)
  • ESLint 10 with a plugin that lists only up to ESLint 9 (here eslint-plugin-react, below)

The fix

Read the peer line in the error. One package says it only supports older React (here ^16 || ^17 || ^18) while you have React 19. Pick one of these, from best to quickest:

1. Switch to a package that supports your React version (best)

Most abandoned packages have a maintained fork or successor. For react-beautiful-dnd that’s @hello-pangea/dnd, which declares react: ^18.0.0 || ^19.0.0:

npm install @hello-pangea/dnd

2. Tell npm the peer is fine, in package.json (overrides)

If you’ve checked that the package works with your React version, record that in package.json so every future install respects it:

{
  "overrides": {
    "react-beautiful-dnd": {
      "react": "$react",
      "react-dom": "$react-dom"
    }
  }
}

$react means “whatever version of react the root project uses”.

3. Turn off strict peer checks for the project (.npmrc)

legacy-peer-deps=true

4. One-off flag

npm install --legacy-peer-deps

This works for that one command. But see below.

The same error with ESLint 10

ESLint 10 came out recently, and many plugins still declare ESLint 9 as their newest supported version. eslint-plugin-react 7.37.5, the current release, is one of them:

npm error Found: eslint@10.14.0
npm error Could not resolve dependency:
npm error peer eslint@"^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" from eslint-plugin-react@7.37.5

The same overrides fix works, pointing the plugin at your ESLint:

{
  "overrides": {
    "eslint-plugin-react": {
      "eslint": "$eslint"
    }
  }
}

The override only tells npm to stop checking. The plugin worked for the rules I ran, but its authors haven’t declared ESLint 10 support yet, so test the rules you rely on.

Who wants which version?

The error names one conflict at a time. npm explain shows every package that depends on a version, and after an override it marks what you changed:

react@19.3.1
node_modules/react
  react@"^19.3.1" from the root project
  peer overridden react@"^19.3.1" (was "^16.8.5 || ^17.0.0 || ^18.0.0") from react-beautiful-dnd@13.1.1

Run npm explain react (or eslint) after any fix to see what you actually told npm.

What didn’t work

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error While resolving: react-beautiful-dnd@13.1.1
npm error Found: react@19.3.1

That’s exactly what your teammates and CI run. With option 2 (overrides), both a clean npm install and npm ci passed. Use option 2 or 3 to make the fix stick.

Why it happens

Since npm 7, npm installs peer dependencies automatically and treats an unmatched peer range as an error. React 19 is newer than many packages’ declared ranges, so upgrading React, or starting a new project on it, triggers this for any package that hasn’t updated its peerDependencies.

Installing past the error doesn’t mean the package actually works on React 19. That only tells you npm stopped complaining. Test the feature you use from it.

How this was tested

First on September 22, 2026 on Windows 11 Pro (npm 11.9.0, Node 24.14.0, React 19.3.0). Re-run on November 1 on GitHub Actions ubuntu-latest with Node 24.22.1, npm 11.19.1 and npm 12.2.1: each conflict in an empty project, then each fix followed by a clean npm install and an npm ci. The ESLint 10 plugin run was on Windows with ESLint 10.14.0. Error text is copied from the runs. The script and the output are public.

— N.K., end of entry No.006

Useful? Pass it on:Post on XFollow @EmotionalMatter

Related entries

  1. No.021

    Fix: typescript-eslint does not support TS 7.0 (ESLint on TS 7)

    When typescript-eslint will support TypeScript 7, why npm refuses the install, and the setup that keeps TypeScript 7 while ESLint runs normally today.

    > npm error code ERESOLVE

    FIXED4 min
  2. No.056

    ESLint "couldn't find an eslint.config.* file" (ESLint 10)

    ESLint 10 dropped .eslintrc for good, and the old escape hatch is gone. Reproduced on 10.12.0, plus the React and Next.js plugin errors that follow.

    > Oops! Something went wrong! :(

    FIXED4 min
  3. No.093

    Fix: bigint Failed to load bindings, pure JS will be used

    bigint: Failed to load bindings, pure JS will be used. Why npm 12 shows it on every install, whether it matters, and how to get the native build back.

    > bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)

    FIXED3 minWindows
  4. No.091

    Fix: npm error code EALLOWREMOTE (and EALLOWGIT), tested

    npm error code EALLOWREMOTE: Fetching packages of type remote have been disabled. Every case reproduced on npm 12, from npx to npm ci, with each fix.

    > npm error code EALLOWREMOTE

    FIXED4 min

Post card · Every Sunday

What broke this week.

One email on Sundays: the Node, TypeScript, Python and AI SDK releases that broke builds that week, each one reproduced, with a link to the fix that worked. Never shared, and you can leave any time.

— Nilay

or follow by RSSor on X

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text