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

Wrong version resolution with ^ of sub-dependency and failed to dedupe #3793

Closed
alexilyaev opened this issue Jul 1, 2017 · 2 comments
Closed
Labels

Comments

@alexilyaev
Copy link

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

Bug

What is the current behavior?

A package being installed twice with different versions where it should be installed once.
Failing to dedupe.

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

In package.json:

  "devDependencies": {
    "stylelint": "7.12.0",
    "stylelint-webpack-plugin": "0.8.0",
  },

stylelint-webpack-plugin has in it's package.json:

  "peerDependencies": {
    "stylelint": "^7.7.0",
  },
  "dependencies": {
    "stylelint": "^7.7.0"
  },

Installing using Yarn v0.27.5

$ yarn list stylelint
yarn list v0.27.5
├─ stylelint-webpack-plugin@0.8.0
│  └─ stylelint@7.11.0
└─ stylelint@7.12.0
Done in 0.90s.
$ yarn why stylelint
yarn why v0.27.5
[1/4] Why do we have the module "stylelint"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
info Has been hoisted to "stylelint"
info This module exists because it's specified in "devDependencies".
info Disk size without dependencies: "3.59MB"
info Disk size with unique dependencies: "13.51MB"
info Disk size with transitive dependencies: "35.55MB"
info Number of shared dependencies: 127

Installing using npm v5.0.3

Works as expected.

Running npm ls stylelint:

├── stylelint@7.12.0 
└─┬ stylelint-webpack-plugin@0.8.0
  └── stylelint@7.12.0  deduped

What is the expected behavior?

  1. Should dedupe in this case
  2. ^7.7.0 should have installed the latest release 7.12.0 (stylelint on npm)
  3. yarn why should show version info and also why the 7.11.0 version was installed

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

Node v6.9.1
npm v5.0.3
Yarn v0.27.5
macOS 10.12.5

Related:

@alexilyaev
Copy link
Author

For now updated in yarn.lock the 7.11.0 version to 7.12.0 and ran yarn --force and it worked:

$ yarn list stylelint
yarn list v0.27.5
└─ stylelint@7.12.0

@bestander
Copy link
Member

#3778 duplicate

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

No branches or pull requests

2 participants