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

yarn --flat sees a version conflict where there is none #3780

Closed
mxmul opened this issue Jun 30, 2017 · 3 comments · Fixed by #4488
Closed

yarn --flat sees a version conflict where there is none #3780

mxmul opened this issue Jun 30, 2017 · 3 comments · Fixed by #4488

Comments

@mxmul
Copy link
Contributor

mxmul commented Jun 30, 2017

Do you want to request a feature or report a bug?
bug

What is the current behavior?
yarn --flat sees a version conflict where there is none (in >=0.27.0).

If I have package A that requires 'left-pad@>=1.0.1" and package B that requires both A and "left-pad@1.1.1", and install package B with yarn --flat there is a conflict.

If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/mxmul/yarn_flat_regression

What is the expected behavior?
yarn would choose the one version that satisfies the version constraints (1.1.1)

Please mention your node.js, yarn and operating system version.
yarn@0.27.1 node@5.11.0 ubuntu@10.04

@bestander
Copy link
Member

Related to #3778 and yarnpkg/rfcs#68

@aij
Copy link
Contributor

aij commented Aug 4, 2017

Yarn can see a conflict even when both dependencies resolve to the same version number:

info Unable to find a suitable version for "history", please choose one by typing one of the numbers below:
  1) "history@^3.0.0" which resolved to "3.3.0"
  2) "history@ccap/history#3.3.0-ccap1" which resolved to "3.3.0"
Answer?: 

Of course the code is actually different depending on whether it is fetched from NPM or from Gitlab.

In our case, NPM will happily use the Gitlab version to satisfy both dependencies. Should Yarn do the same?

Admittedly, this is a hacky way to get NPM to use our patched version of history within an unpatched react-router. The new resolutions feature in Yarn seems like a cleaner way to accomplish the same, albeit incompatible with NPM.

@aij
Copy link
Contributor

aij commented Aug 7, 2017

Ugh, that's actually worse than I realized. Even though it's prompting, the answer is effectively ignored in my above example, since the call to reporter.select returns just the string 3.3.0 in either case.

@BYK BYK closed this as completed in #4488 Sep 22, 2017
BYK pushed a commit that referenced this issue Sep 22, 2017
…el dependency (#4488)

**Summary**

Fixes #3780, and makes the failing test from #3779 passing.

As a final step of package resolution, for each dependency we check whether any version satisfies all resolved version ranges. 

**Test plan**

Fixes an existing (failing) test: "unbound transitive dependencies should not conflict with top level dependency"
BYK added a commit that referenced this issue Sep 27, 2017
… with top level dependency (#4488)"

**Summary**

Fixes #4547, unfixes #3780 by reverting #4488 (commit 4020ccd).

**Test plan**

Existing unit tests.
joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…el dependency (yarnpkg#4488)

**Summary**

Fixes yarnpkg#3780, and makes the failing test from yarnpkg#3779 passing.

As a final step of package resolution, for each dependency we check whether any version satisfies all resolved version ranges. 

**Test plan**

Fixes an existing (failing) test: "unbound transitive dependencies should not conflict with top level dependency"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants