Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] peer-dependency conflict when having "greater than or equal to" range >= #2553

Closed
talsi opened this issue Jan 27, 2021 · 8 comments · Fixed by npm/arborist#266
Closed
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@talsi
Copy link

talsi commented Jan 27, 2021

Current Behavior:

conflict error when peer-dependency has >= range. looks like it tries to install the highest version possible instead of being loose and choose a satisfying version.

  • @angular-slider/ngx-slider@2.0.3 has peer-dependency of @angular/common: >=6.1.0
  • @angular/forms@10.2.4 has peer-dependency of @angular/common: 10.2.4.
  • @angular/common@10.2.4 seems to satisfy the both requirements yet it fails

Expected Behavior:

successful install, choosing compatible version.

Steps To Reproduce:

run npm i @angular/forms@^10.2.4 @angular-slider/ngx-slider@^2.0.3

Result

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: untitled36@1.0.0
npm ERR! Found: @angular/common@11.1.0
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@">=6.1.0" from @angular-slider/ngx-slider@2.0.3
npm ERR!   node_modules/@angular-slider/ngx-slider
npm ERR!     @angular-slider/ngx-slider@"2.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"10.2.4" from @angular/forms@10.2.4
npm ERR! node_modules/@angular/forms
npm ERR!   @angular/forms@"10.2.4" from the root project
npm ERR!   peer @angular/forms@">=6.1.0" from @angular-slider/ngx-slider@2.0.3
npm ERR!   node_modules/@angular-slider/ngx-slider
npm ERR!     @angular-slider/ngx-slider@"2.0.3" 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.

Environment:

node: 15.6.0
npm: 7.4.0

@talsi talsi added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jan 27, 2021
@darcyclarke darcyclarke reopened this Feb 2, 2021
@darcyclarke darcyclarke added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Feb 2, 2021
@darcyclarke darcyclarke added this to the OSS - Sprint 23 milestone Feb 2, 2021
@darcyclarke
Copy link
Contributor

@talsi can you update to the latest v7 (ie. npm i -g npm - v7.5.6) - this should have been fixed in v7.5.5 - https://github.com/npm/cli/releases/tag/v7.5.5 Let me know if you're still experiencing this problem & we can reopen the issue.

@talsi
Copy link
Author

talsi commented Feb 24, 2021

@darcyclarke

hi,

I'm still having the same issue using npm v7.5.6

`npm -v && npm i @angular/forms@^10.2.4 @angular-slider/ngx-slider@^2.0.3`
7.5.6
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: untitled41@1.0.0
npm ERR! Found: @angular/common@11.2.2
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@">=6.1.0" from @angular-slider/ngx-slider@2.0.3
npm ERR!   node_modules/@angular-slider/ngx-slider
npm ERR!     @angular-slider/ngx-slider@"2.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"10.2.4" from @angular/forms@10.2.4
npm ERR! node_modules/@angular/forms
npm ERR!   @angular/forms@"10.2.4" from the root project
npm ERR!   peer @angular/forms@">=6.1.0" from @angular-slider/ngx-slider@2.0.3
npm ERR!   node_modules/@angular-slider/ngx-slider
npm ERR!     @angular-slider/ngx-slider@"2.0.3" 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.

image

@JoshMcCullough
Copy link

Using NPM 7.6.0 and we are seeing the same / similar issue. SO post: https://stackoverflow.com/questions/66426787/npm-7-complains-about-peer-dependency-even-though-version-is-in-range

@talsi
Copy link
Author

talsi commented Mar 4, 2021

@darcyclarke
please reopen the bug.
it's not fixed.

@Heatmanofurioso
Copy link

Any news on this issue?
It has impact on many developers and libraries

@talsi
Copy link
Author

talsi commented Apr 26, 2021

@isaacs hi,

it seems like this fix (npm/arborist#266) doesn't solve the issue completely.
i'm not sure if it's because the fix is partial and doesn't handle all cases or if there's an issue in some other place because i'm still having errors of conflicting peer dependencies (where there shouldn't be).

steps to reproduce (using npm 7.11.1)

  1. open an empty project / folder (package.json doesn't list any dependencies or devDependencies)
  2. run npm i @angular/cdk@"^10.2.5" @angular/forms@"^10.2.4"

result:
image

@angular/cdk has peer dependency on
@angular/common@"^10.0.0 || ^11.0.0-0" and on @angular/core@"^10.0.0 || ^11.0.0-0"

instead of choosing
@angular/common@10.2.5 (and then @angular/core@10.2.5) that would have satisfy all
it chooses
@angular/common@11.2.11 (and then @angular/core@11.2.11) that results in a conflict

@nlf
Copy link
Contributor

nlf commented Apr 26, 2021

hi @talsi, can you please open this as a new issue? the fix for this one will be different, so i'd like to track it separately but i'll be looking into this!

@talsi
Copy link
Author

talsi commented Apr 26, 2021

@nlf sure, np.
#3152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants