npm / npm/cli

[BUG] npm install incorrect resolve peerDependencies with exact versioning

Open
#6,476 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 9.x
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
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

image

Expected Behavior

install all package version 1.0.6 completely)

Steps To Reproduce
  1. In this environment node@18.16.0 npm@9.5.1
  2. git clone https://github.com/Naymi/npm-install-incorrect-resolve-peer && cd npm-install-incorrect-resolve-peer
  3. Run 'npm install'
  4. See error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: npm-install-incorrect-resolve-peer@1.0.0
npm ERR! Found: @rsdk/common@1.0.6
npm ERR! node_modules/@rsdk/common
npm ERR!   @rsdk/common@"1.0.6" from the root project
npm ERR!   peer @rsdk/common@"^1.0.6" from @rsdk/core@1.0.6
npm ERR!   node_modules/@rsdk/core
npm ERR!     @rsdk/core@"1.0.6" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @rsdk/common@"^1.0.8" from @rsdk/decorators@1.0.8
npm ERR! node_modules/@rsdk/decorators
npm ERR!   peer @rsdk/decorators@"^1.0.6" from @rsdk/core@1.0.6
npm ERR!   node_modules/@rsdk/core
npm ERR!     @rsdk/core@"1.0.6" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/gitpod/.npm/_logs/2023-05-19T12_27_37_807Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitpod/.npm/_logs/2023-05-19T12_27_37_807Z-debug-0.log
Environment
  • npm: 9.5.1
  • Node.js: 18.16.0
  • OS Name: Ubuntu 22.04.2 LTS x86_64
  • System Model Name: Google Compute Engine
  • npm config:
; node bin location = /home/gitpod/.nvm/versions/node/v18.16.0/bin/node
; node version = v18.16.0
; npm local prefix = /workspace/npm-install-incorrect-resolve-peer
; npm version = 9.5.1
; cwd = /workspace/npm-install-incorrect-resolve-peer
; HOME = /home/gitpod
; Run `npm config ls -l` to show all defaults.

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

Clone the linked npm-install-incorrect-resolve-peer repository and run npm install with Node.js 18.16.0 and npm 9.5.1 to reproduce the ERESOLVE output. Start by tracing npm's peer dependency resolution for the @rsdk packages; done means the reported exact versions install without an incorrect dependency conflict.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.