You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can tell, yarn satisfies peer dependencies by finding the closest match anywhere in the tree. This is unexpected when the top-level project depends on module A at version x, a dependency B depends on module A at version y, and another dependency C peer depends on module A for some version that y satisfies that x does not.
I would expect dependency C to use A@x (what's specified in the top-level package.json file), instead of copying A@y from dependency B.
If the current behavior is a bug, please provide the steps to reproduce.
$ yarn init
$ yarn add -D [email protected]
$ yarn add -D [email protected]# has dependency "webpack": "^1.12.9"
$ yarn add -D [email protected]# has peer dependency "webpack": "^1.1.0 || ^2 || ^2.1.0-beta.0 || ^2.2.0-rc.0"
$ grep version node_modules/karma-webpack/node_modules/webpack/package.json
"version": "1.15.0",
$ yarn why node_modules/karma-webpack/node_modules/webpack/
yarn why v0.23.3
[1/4] 🤔 Why do we have the module "node_modules/karma-webpack/node_modules/webpack/"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
error We couldn't find a match!✨ Done in 0.37s.
What is the expected behavior?
Expected karma-webpack to not have its own version of webpack, but use the top-level copy (3.0.0), perhaps with a warning that the peer dependency is not satisfied.
Failing that, perhaps allow yarn install --flat for specific packages (webpack in this case) rather than needing to resolve every duplicate module in the project.
Please mention your node.js, yarn and operating system version.
node v6.10.2
yarn 0.23.3
macOS Sierra 10.12.5
The text was updated successfully, but these errors were encountered:
This looks crazy, node_modules/karma-webpack/node_modules/webpack/ should not be installed at all and Yarn should display a warning that webpack peer dependency is not satisfied.
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
As far as I can tell, yarn satisfies peer dependencies by finding the closest match anywhere in the tree. This is unexpected when the top-level project depends on module A at version x, a dependency B depends on module A at version y, and another dependency C peer depends on module A for some version that y satisfies that x does not.
I would expect dependency C to use A@x (what's specified in the top-level package.json file), instead of copying A@y from dependency B.
If the current behavior is a bug, please provide the steps to reproduce.
repro repo is here: https://github.com/alunny/yarn-peerdeps-example
to repro from scratch:
What is the expected behavior?
Expected karma-webpack to not have its own version of webpack, but use the top-level copy (3.0.0), perhaps with a warning that the peer dependency is not satisfied.
Failing that, perhaps allow
yarn install --flat
for specific packages (webpack in this case) rather than needing to resolve every duplicate module in the project.Please mention your node.js, yarn and operating system version.
node v6.10.2
yarn 0.23.3
macOS Sierra 10.12.5
The text was updated successfully, but these errors were encountered: