PeerDependencies, one of the terms that brought up confusion at least to me when I got a PeerDependency warning in my terminal like the following:
...
For further actions, you may consider blocking this person and/or reporting abuse
Nice article. I got several questions about it.
Hey!
Thx for your questions.
what you've described, is what the maintainer of the react-redux package has already done, see here github.com/reduxjs/react-redux/blo.... That's the reason why the warning is thrown here. The solution to this warning is, that the developer of that project (that uses react-redux) has to add react@0.14.0 on its own as a project dependency.
"... I assume the person who call jacksFunction already know the exact version it needs." > the person who calls jacksFunction might not necessarily know this when installing and initially using the npm package
jacksmodule
. The definition of a peer dependency in jacksmodule's package.json will throw the helping hint that the person should install the proper version of jillsModule.Hope that helped to answer your questions (?).
Thx
I specially signed in to write a comment for this article. Really thank you, man. It's already 2 months I can't really understand and even find a good article related to peerDependencies. One small thing I couldn't understand from StackOverflow answer and from this article is it.
From StackOverflow -
How peer dependencies solve this.
They tell npm
I need this package, but I need the version that is part of the project,
not some version private to my module.
From this article -
"Hey, this is JacksModule speaking here. Let me tell you: I need this
specific package of JillsModule, but I really need the version that is
part of my JacksModule project and listed in my package.json file. So
please make sure it's installed and make sure it's not some other version
of JillsModule you might have installed for your own usage somewhere else
in your application."
Note the difference. You say that
I need this
and StackOverflow saysspecific package of JillsModule, but I really need the version that is
part of my JacksModule project and listed in my package.json file.
I need this package, but I need the version that is part of the project,
not some version private to my module.
Could you please explain it ?
This is pretty cool and awesome.
thank you!
No online resource was clear enough for me to understand peerDependencies except this one. Great Article!
thank you! happy I could help!
Nice article! Thanks!
thx!
Finally found an explanation that makes me feel confortable, thanks
nice, glad it helped you!
Thank you, great overview, it certainly helped clarify things for me. Keep up the great work! :)
glad to read that, thx!