-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #5514
Comments
You have a dependency on
Back in You get the warning because no package that is a parent of In this case your project is the only parent to So running:
should fix your issue. There is a longer writeup of how peerDeps work on the node blog: https://nodejs.org/en/blog/npm/peer-dependencies/ Hope that makes sense! (going to close this issue since this hopefully answers your question, but if you have additional questions, don't hesitate to ask.) |
@rally25rs thanks so much for that information :), i was stepping through the code and your explanation makes what i saw in the code make much more sense :). |
@rally25rs i did more investigation into the difference in npm v5.x vs yarn. it seems that in npm 5 if a sibling dependency includes a package defined in the peerDependencies of the other sibling it won't show the error. if no sibling package or parent package includes the target dependency it will show the error //no error
//shows error
i can't find any docs that explain the behaviour but i think if the dependency is installed at the first depth of the tree it won't show the warning. what are your thoughts on the difference of behaviour. i tested using npm v5.7.1 |
That feels like an npm bug to me. If you think of it as a dependency tree:
If Now in reality, it actually does resolve at runtime, only because nom and yarn both will "hoist" the packages to a flat dir structure:
but that feels like more of a side-effect of the hoisting, rather than really satisfying the peerDependency. On the plus side, it's just a warning and not an error, so you can safely ignore it in this case. |
found a duplicate: #4675 |
thanks, ill continue discussion on that thread. |
Bug
It seems like a bug, but if you know why it gives this error and is not a bug would love an explanation :). if it is a bug would be happy to help out and fix it.
What is the current behavior?
![image](https://user-images.githubusercontent.com/1640136/37363352-a9484be8-2732-11e8-91c4-6d18cbc6411e.png)
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Does not give a warning about missing dependencies
Please mention your node.js, yarn and operating system version.
node v8.0.0 / macOS10.13.3
The text was updated successfully, but these errors were encountered: