yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Yarn installs child dependency when there already is root dependency with matching version

Open LaserUnicorns opened this issue 9 years ago • 3 comments

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

What is the current behavior? Yarn installs child dependency, yet there is root dependency with matching version

yarn list v1.2.1
├─ [email protected]
│  ├─ moment@>= 2.9.0
│  └─ [email protected]
└─ [email protected]

moment-timezone depends on moment@>=2.9.0, there already is [email protected], but Yarn still installs additional moment package with different version as child of moment-timezone

If the current behavior is a bug, please provide the steps to reproduce.

yarn add [email protected]
yarn add moment-timezone

What is the expected behavior? Yarn should not install [email protected]

Please mention your node.js, yarn and operating system version. Node 6.11.4 Yarn 1.2.1 Windows 10

LaserUnicorns avatar Oct 18 '17 12:10 LaserUnicorns

We have the same problem with jquery:

yarn list --pattern jquery
yarn list v1.2.1
├─ [email protected]
│  └─ [email protected]
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
Done in 1.04s.

The jquery dependency in bootstrap-datepicker is defined as followed:

"dependencies": {
  "jquery": ">=1.7.1 <4.0.0"
}

This results in double inclusion of jquery in our browserify process. :(

Wohlie avatar Oct 19 '17 15:10 Wohlie

I'm experiencing the exact same issue with Moment. I noticed a similar issue for the root cause here #4686

Evilweebl avatar Oct 24 '17 07:10 Evilweebl

This is not an issue in 1.1.0 - I have downgraded from 1.2.x because of this issue.

thrashard avatar Oct 24 '17 21:10 thrashard