-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
I am experiencing inconsistent behavior of updating packages to their latest version via npm install <example-package>
and npm install -E <example-package>@version
even though these two have the same final outcome.
When I try to install the exact latest version of several packages I'm working with I get the following error:
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: reproduce-peerdep-issue@1.0.0
npm error Found: @typescript-eslint/eslint-plugin@8.32.1
npm error node_modules/@typescript-eslint/eslint-plugin
npm error peerOptional @typescript-eslint/eslint-plugin@"^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0" from eslint-plugin-unused-imports@4.1.4
npm error node_modules/eslint-plugin-unused-imports
npm error eslint-plugin-unused-imports@"^4.1.4" from the root project
npm error @typescript-eslint/eslint-plugin@"8.32.1" from typescript-eslint@8.32.1
npm error node_modules/typescript-eslint
npm error typescript-eslint@"^8.32.1" from the root project
npm error 1 more (the root project)
npm error
npm error Could not resolve dependency:
npm error @typescript-eslint/eslint-plugin@"^8.32.1" from the root project
npm error
npm error Conflicting peer dependency: @typescript-eslint/parser@8.37.0
npm error node_modules/@typescript-eslint/parser
npm error peer @typescript-eslint/parser@"^8.37.0" from @typescript-eslint/eslint-plugin@8.37.0
npm error node_modules/@typescript-eslint/eslint-plugin
npm error @typescript-eslint/eslint-plugin@"^8.32.1" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /Users/matthewlin/.npm/_logs/2025-07-16T04_44_38_789Z-eresolve-report.txt
npm error A complete log of this run can be found in: /Users/matthewlin/.npm/_logs/2025-07-16T04_44_38_789Z-debug-0.log
Expected Behavior
I would expect the exact version install to not fail as the install without specifying installs the version I'm specifying anyways.
Steps To Reproduce
Pasted from: https://github.com/matthew-plusprogramming/reproduce-peerdep-issue
Steps to reproduce:
- Run
npm i
- Run
npm i -E @typescript-eslint/eslint-plugin@8.37.0 @typescript-eslint/parser@8.37.0 typescript-eslint@8.37.0
NOTE: This does not happen if instead of running with -E
you simply run:
npm i @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript-eslint
but, once you encounter the error caused by #2 above, running even the command without exact versions no longer works even though: package.json
and package-lock.json
are identical.
Environment
- npm: 11.4.2
- Node.js: 22.14.0
- OS Name: OSX Darwin
- System Model Name: Macbook Pro 2024
- npm config:
; node bin location = /Users/matthewlin/.nvm/versions/node/v22.14.0/bin/node
; node version = v22.14.0
; npm local prefix = /Users/matthewlin/test/reproduce-peerdep-issue
; npm version = 11.4.2
; cwd = /Users/matthewlin/test/reproduce-peerdep-issue
; HOME = /Users/matthewlin
; Run `npm config ls -l` to show all defaults.