Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

fix: correctly handle peer conflicts between peers - #266

Merged
isaacs merged 1 commit into
mainfrom
nlf/eresolve-fixes
Apr 21, 2021
Merged

fix: correctly handle peer conflicts between peers#266
isaacs merged 1 commit into
mainfrom
nlf/eresolve-fixes

Conversation

@nlf

@nlf nlf commented Apr 15, 2021

Copy link
Copy Markdown
Contributor

this corrects the case where a project has dependencies that have peer dependencies with different, yet overlapping required ranges such that we correctly identify the resolved version that matches as many needs as possible.

References

closes npm/cli#2553
closes npm/cli#2999
closes npm/cli#3083

@nlf

nlf commented Apr 15, 2021

Copy link
Copy Markdown
Contributor Author

the two failing runs were transient failures during the tests, socket timeouts. since only one event failed while the other passed for the two that failed, this seems safe to ignore.

@isaacs
isaacs force-pushed the nlf/eresolve-fixes branch from 82b8d83 to 44cd2ae Compare April 21, 2021 17:38
@isaacs isaacs closed this in 44cd2ae Apr 21, 2021
@isaacs
isaacs merged commit 44cd2ae into main Apr 21, 2021
@wraithgar
wraithgar deleted the nlf/eresolve-fixes branch April 22, 2021 17:38
@princemaple

Copy link
Copy Markdown

Is this in npm 7.11.1? I just updated to this version and ng update still getting errors.

@talsi

talsi commented Apr 26, 2021

Copy link
Copy Markdown

@princemaple hi,

the fix is in version 2.4.0 of "@npmcli/arborist" package.

npm 7.11.1 has a dependency on version "^2.4.0" of "@npmcli/arborist".

so, yes, this is in npm 7.11.1, nonetheless, it seems like this fix 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 also 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

@princemaple

Copy link
Copy Markdown

thanks for the confirmation @talsi

@rarkins

rarkins commented Apr 26, 2021

Copy link
Copy Markdown

@talsi is there any new or reopened issue to track this? Perhaps best for you to do it as you have a nice clean reproduction?

@talsi

talsi commented Apr 26, 2021

Copy link
Copy Markdown

@rarkins

i'm waiting for npm/cli#2553 to reopen

npm/cli#3152

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

5 participants