Yarn: Strange version resolving

Created on 17 Oct 2016  ยท  4Comments  ยท  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
Bug
What is the current behavior?
package.json

{
  "dependencies": {
    "devbridge-autocomplete": "^1.2.26",
    "jquery": "2.1.2"
  }
}

Will install:

devbridge-autocomplete:
  version "1.2.26"
  resolved "https://registry.yarnpkg.com/devbridge-autocomplete/-/devbridge-autocomplete-1.2.26.tgz#e491e01b701ba0ff509afaf4ee1eca69a9d00647"
  dependencies:
    jquery ">=1.7"

jquery@>=1.7:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.1.1.tgz#347c1c21c7e004115e0a4da32cece041fad3c8a3"

[email protected]:
  version "2.1.2"
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.1.2.tgz#b68f154cb2ea4731924883e9fe20ec199d1dc1e2"


What is the expected behavior?
Install jquery once with version = 2.1.2
Please mention your node.js, yarn and operating system version.

$ node -v
v6.7.0
$ yarn -v
yarn install v0.15.1
cat-bug

Most helpful comment

npm example

> mkdir npm-test && cd npm-test
> npm init --yes
> npm install --save [email protected] [email protected]
[email protected] /npm-test
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

yarn example

> mkdir yarn-test && cd yarn-test
> yarn add [email protected] [email protected]
yarn add v0.16.0
info No lockfile found.
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 3 new dependencies.
โ”œโ”€ [email protected]
โ”‚  โ””โ”€ [email protected]
โ””โ”€ [email protected]
โœจ  Done in 6.26s.

All 4 comments

Same problem here

{
  "dependencies": {
    "jquery": "2.2.4",
    "parsleyjs": "2.5.1"
  }
}
jquery@>=1.8.0:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.1.1.tgz#347c1c21c7e004115e0a4da32cece041fad3c8a3"

[email protected]:
  version "2.2.4"
  resolved "https://registry.yarnpkg.com/jquery/-/jquery-2.2.4.tgz#2c89d6889b5eac522a7eea32c14521559c6cbf02"

[email protected]:
  version "2.5.1"
  resolved "https://registry.yarnpkg.com/parsleyjs/-/parsleyjs-2.5.1.tgz#6380924e231c38b6eca3a597d7ebc0dde41ceb9f"
  dependencies:
    jquery ">=1.8.0"

Parsley depends on jquery@>=1.8.0, but 3.1.1 is still being installed even though 2.2.4 should satisfy it.

$ node -v
v6.9.0
$ yarn --version
0.16.0

+1

npm example

> mkdir npm-test && cd npm-test
> npm init --yes
> npm install --save [email protected] [email protected]
[email protected] /npm-test
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

yarn example

> mkdir yarn-test && cd yarn-test
> yarn add [email protected] [email protected]
yarn add v0.16.0
info No lockfile found.
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
[4/4] ๐Ÿ“ƒ  Building fresh packages...
success Saved lockfile.
success Saved 3 new dependencies.
โ”œโ”€ [email protected]
โ”‚  โ””โ”€ [email protected]
โ””โ”€ [email protected]
โœจ  Done in 6.26s.

Fixed via #1477.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IlCallo picture IlCallo  ยท  123Comments

OshotOkill picture OshotOkill  ยท  80Comments

whitecolor picture whitecolor  ยท  96Comments

jiripospisil picture jiripospisil  ยท  128Comments

MichelDiz picture MichelDiz  ยท  80Comments