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

package-resolver should not optimize yarn.lock by default #3490

Closed
bestander opened this issue May 24, 2017 · 0 comments
Closed

package-resolver should not optimize yarn.lock by default #3490

bestander opened this issue May 24, 2017 · 0 comments

Comments

@bestander
Copy link
Member

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

What is the current behavior?

If yarn.lock has this entry

babel-runtime@^6.0, babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1, babel-runtime@^6.9.2:
  version "6.18.0"
  resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.18.0.tgz#0f4177ffd98492ef13b9f823e9994a02584c9078"
  dependencies:
    core-js "^2.4.0"
    regenerator-runtime "^0.9.5"

babel-runtime@^6.22.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
  dependencies:
    core-js "^2.4.0"
    regenerator-runtime "^0.10.0"

Yarn would try to optimize it and use the highest compatible resolution everywhere, specifically after yarn install the lockfile will be optimized into

babel-runtime@^6.0, babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1, babel-runtime@^6.9.2, babel-runtime@^6.22.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b"
  dependencies:
    core-js "^2.4.0"
    regenerator-runtime "^0.10.0"

And the packages will be installed 6.23 everywhere.

What is the expected behavior?

Yarn should respect yarn.lock that was generated earlier to achieve installation determinism.
Otherwise people will get unexpected changes to installation tree.

Please mention your node.js, yarn and operating system version.
Yarn 0.26

@arcanis arcanis self-assigned this May 30, 2017
arcanis pushed a commit to arcanis/yarn that referenced this issue Jun 26, 2017
arcanis pushed a commit to arcanis/yarn that referenced this issue Jun 26, 2017
arcanis added a commit that referenced this issue Jun 27, 2017
* Resolves non-fresh-packages with the exact version specified in the lockfile if possible, fixes #3490

* Adds a test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants