npm / npm/cli

[BUG] ERESOLVE when npm install new package versions with peer dependencies

Open
#9,324 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Priority 2
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Is there an existing issue for this?
  • I have searched the existing issues
possibly related
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

The issue might be a repeat of something similar. But anyways, Starting from a clean install state e.g. 'eslint@9.39.2', '@eslint/js@9.39.2', 'typescript-eslint@8.50.0'

dependency upgrade chore (e.g. with renovate) wants to update the package versions to

eslint@10.2.0 @eslint/js@10.0.1 typescript-eslint@8.58.0

how ever this fails as npm cannot resolve the peerdependencies between those packages

Expected Behavior

Deleting the lockfile. or starting with the new state with the newer versions works fine. so ideally npm should find the transition path between the old and the new dependency trees automatically.

Workarounds
  • when updating the stricter requirements package typescript-eslint@8.50.0 (which has peers eslint@"^8.57.0 || ^9.0.0") first:
$ npm install -D --save-exact typescript-eslint@8.58.0
# and then
$ npm install -D --save-exact eslint@10.2.0 @eslint/js@10.0.1 typescript-eslint@8.58.0
  • likewise, updating esling alone first also works (with some peer deps warnings):
$ npm install -D --save-exact eslint@10.2.0
# and then
$ npm install -D --save-exact eslint@10.2.0 @eslint/js@10.0.1 typescript-eslint@8.58.0
Steps To Reproduce
  1. empty workspace mkdir temp && cd temp
  2. init npm npm init -y
  3. The initial Start state: npm install -D --save-exact eslint@9.39.2 @eslint/js@9.39.2 typescript-eslint@8.50.0
  4. package updater tries to update the packages.
    npm install -D --save-exact eslint@10.2.0 @eslint/js@10.0.1 typescript-eslint@8.58.0
  5. See error:
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: eslint-test-project@1.0.0
npm error Found: @eslint/js@9.39.2
npm error node_modules/@eslint/js
npm error   @eslint/js@"9.39.2" from eslint@9.39.2
npm error   node_modules/eslint
npm error     peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/eslint-utils@4.9.1
npm error     node_modules/@eslint-community/eslint-utils
npm error       @eslint-community/eslint-utils@"^4.7.0" from @typescript-eslint/utils@8.50.0
npm error       node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils
npm error         @typescript-eslint/utils@"8.50.0" from @typescript-eslint/eslint-plugin@8.50.0
npm error         node_modules/@typescript-eslint/eslint-plugin
npm error       3 more (@typescript-eslint/utils, eslint, @typescript-eslint/utils)
npm error     peer eslint@"^8.57.0 || ^9.0.0" from @typescript-eslint/eslint-plugin@8.50.0
npm error     node_modules/@typescript-eslint/eslint-plugin
npm error       @typescript-eslint/eslint-plugin@"8.50.0" from typescript-eslint@8.50.0
npm error       node_modules/typescript-eslint
npm error         dev typescript-eslint@"8.58.0" from the root project
npm error     7 more (@typescript-eslint/utils, @typescript-eslint/parser, ...)
npm error   dev @eslint/js@"10.0.1" from the root project
npm error
npm error Could not resolve dependency:
npm error dev @eslint/js@"10.0.1" from the root project
npm error
npm error Conflicting peer dependency: eslint@10.2.0
npm error node_modules/eslint
npm error   peerOptional eslint@"^10.0.0" from @eslint/js@10.0.1
npm error   node_modules/@eslint/js
npm error     dev @eslint/js@"10.0.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error \npm-cache\_logs\2026-05-07T10_05_05_410Z-eresolve-report.txt
npm error A complete log of this run can be found in: \npm-cache\_logs\2026-05-07T10_05_05_410Z-debug-0.log
Environment
  • npm: 11.14.0
  • Node.js: v24.15.0
  • OS Name:
  • System Model Name:
  • npm config:
; copy and paste output from `npm config ls` here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two npm install commands in the issue, using the listed package versions, and compare the resolver error with the successful sequential updates. Trace the dependency-resolution behavior involved in updating peer-dependent packages; done means the combined update finds a valid transition without requiring lockfile deletion or sequential installs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, devtools
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.