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

"Unmet peer dependency" with peer dependency already installed as transitive dep #2688

Closed
guigrpa opened this issue Feb 13, 2017 · 14 comments · Fixed by #4478
Closed

"Unmet peer dependency" with peer dependency already installed as transitive dep #2688

guigrpa opened this issue Feb 13, 2017 · 14 comments · Fixed by #4478

Comments

@guigrpa
Copy link

guigrpa commented Feb 13, 2017

Bug

What is the current behavior?

  1. Install dependency A (with transitive dependency AB)
  2. Later (contrary to Unmet peer dependency warning when the peer dependency is installed at the same time #2132), install dependency C (which has AB as peer dep) -- an unmet peer dependency warning appears, even though AB was installed in the first step.

Repro

Step 1 output (notice that storyboard-core is installed as a normal dependency of storyboard):

$ yarn init -y
$ yarn add storyboard@3.0.0-rc.1
yarn add v0.19.1
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 13 new dependencies.
...
├─ storyboard-core@3.0.0-rc.0
├─ storyboard@3.0.0-rc.1
...
Done in 4.25s.

Step 2 output (with storyboard-core in its peerDependencies; notice the warning):

$ yarn add storyboard-listener-console@3.0.0-rc.1
yarn add v0.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "storyboard-listener-console@3.0.0-rc.1" has unmet peer dependency "storyboard-core@^3.0.0-rc.0".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ storyboard-listener-console@3.0.0-rc.1
Done in 1.36s.

Despite the warning, the installation is successful. Also note that no peer-dep warning appears with npm install.

What is the expected behavior? No warning, since the peer dependency is already installed (with exactly the required version).

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

Node v7.3.0
yarn v0.19.1
Windows 7 (also observed in OS X Sierra)

@CrabDude
Copy link
Contributor

Still seeing in yarn@0.28.1:

// empty directory
$ yarn add webpack@3

@BYK
Copy link
Member

BYK commented Sep 15, 2017

@guigrpa your issue seems to be fixed on latest master.
@CrabDude your issue seems to be fixed with #4478.

@BYK BYK closed this as completed in #4478 Sep 16, 2017
BYK added a commit that referenced this issue Sep 16, 2017
…4478)

**Summary**

Fixes #4446, fixes #4433, fixes #2688, fixes #2387. Follow up to #3803. The fix in #3893 was
too aggressive, allowing only top-level dependencies to be used in
peer dependency resolution which was incorrect. This patch allows
resolving peer dependencies from the same or higher levels in the
dependency tree.

**Test plan**

Additional unit and integration tests.
@valclark1
Copy link

@BYK I updated yarn based and the still persists for me when installing create-react-app globally.

~|⇒ yarn global add  create-react-app
yarn global v1.0.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "graphcool-styles@0.1.42" has incorrect peer dependency "react@^0.15.0".
warning "graphiql@0.11.3" has incorrect peer dependency "graphql@^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.9.0 || ^0.10.0".
warning "graphiql@0.11.3" has incorrect peer dependency "prop-types@>=15.5.0".
warning "graphiql@0.11.3" has incorrect peer dependency "react@^15.6.0".
warning "graphiql@0.11.3" has incorrect peer dependency "react-dom@^15.6.0".
warning "react-dom@15.6.1" has incorrect peer dependency "react@^15.6.1".
warning "react-modal@1.9.7" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning "react-modal@1.9.7" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning "react-redux@5.0.6" has incorrect peer dependency "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0".
warning "react-redux@5.0.6" has incorrect peer dependency "redux@^2.0.0 || ^3.0.0".
warning "react-transition-group@1.2.0" has incorrect peer dependency "react@^15.0.0".
warning "react-transition-group@1.2.0" has incorrect peer dependency "react-dom@^15.0.0".
warning "react-virtualized@8.11.4" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning "react-virtualized@8.11.4" has incorrect peer dependency "react-addons-shallow-compare@^0.14.0 || ^15.0.0".
warning "react-virtualized@8.11.4" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning "svgo-loader@1.2.1" has unmet peer dependency "svgo@>=0.4.0".
warning "html-webpack-plugin@2.30.1" has unmet peer dependency "webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3".
warning "webpack-dev-server@1.16.5" has unmet peer dependency "webpack@>=1.3.0 <3".
warning "codemirror-graphql@0.6.11" has incorrect peer dependency "codemirror@^5.26.0".
warning "codemirror-graphql@0.6.11" has incorrect peer dependency "graphql@^0.6.0 || ^0.7.0 || ^0.8.0-b || ^0.8.0 || ^0.9.0 || ^0.10.0".
warning "graphql-subscriptions@0.4.4" has incorrect peer dependency "graphql@^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.1".
warning "graphql-tag@2.4.2" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0".
warning "webpack-dev-middleware@1.12.0" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
[4/4] 📃  Building fresh packages...
success Installed "create-react-app@1.4.0" with binaries:
      - create-react-app
✨  Done in 5.32s.

Any help would be appreciated.

@BYK
Copy link
Member

BYK commented Sep 17, 2017

@javonclarke this issue is not fixed in 1.0.2, only on nightlies right now: https://yarnpkg.com/en/docs/nightly

@valclark1
Copy link

@BYK Ah thank you.

@guigrpa
Copy link
Author

guigrpa commented Sep 18, 2017

@BYK Thanks for the effort!

joaolucasl pushed a commit to joaolucasl/yarn that referenced this issue Oct 27, 2017
…arnpkg#4478)

**Summary**

Fixes yarnpkg#4446, fixes yarnpkg#4433, fixes yarnpkg#2688, fixes yarnpkg#2387. Follow up to yarnpkg#3803. The fix in yarnpkg#3893 was
too aggressive, allowing only top-level dependencies to be used in
peer dependency resolution which was incorrect. This patch allows
resolving peer dependencies from the same or higher levels in the
dependency tree.

**Test plan**

Additional unit and integration tests.
@Hypnosphi
Copy link

Hypnosphi commented Nov 16, 2017

I can reproduce the issue using OP's instructions in 1.3.2:

...
warning " > storyboard-listener-console@3.0.0-rc.1" has unmet peer dependency "storyboard-core@^3.0.0-rc.0".
...

$ yarn list storyboard-core
warning Filtering by arguments is deprecated. Please use the pattern option instead.
└─ storyboard-core@3.1.3

I checked on http://jubianchi.github.io/semver-check/, and it says that "3.1.3 satisfies constraint ^3.0.0-rc.0"

@greggb
Copy link

greggb commented Nov 17, 2017

Is there anything I can do to help with a repro case? The Storybook issue is pretty much exactly what I'm seeing in my project as well on the latest release.

@BYK
Copy link
Member

BYK commented Nov 20, 2017

@Hypnosphi @greggb I think this is a separate issue. Sounds a bit like #4850 so feel free to comment there and follow it.

@Hypnosphi
Copy link

@BYK Do yo mean the one in storybook? Yeah, probably. But note that this one is also reproduceable right now

@BYK
Copy link
Member

BYK commented Nov 20, 2017

@Hypnosphi commenting under a closed issue won't get us any visibility, that's why I'm promoting an already open issue which seems like what you are reporting here :)

@Hypnosphi
Copy link

Hypnosphi commented Nov 20, 2017

commenting under a closed issue won't get us any visibility

Should I open a new one instead, with exactly the same title and body? I just followed instructions from #2688 (comment) and got the same warning as OP using 1.3.2

@BYK
Copy link
Member

BYK commented Nov 20, 2017

@Hypnosphi yes, with a repro repo so we can reproduce locally without any other context of information and then fix it.

@greggb
Copy link

greggb commented Nov 20, 2017

Thanks BYK

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

Successfully merging a pull request may close this issue.

6 participants