What is it about peer dependencies that give the host more flexibility in choosing the specific version?
Real question, not a challenge! I really don't understand this stuff, I've always found javascript dependency management very confusing.
The example used in this post[1] on the Node blog is plugin systems, which is a very common expression of this pattern.
> Real question, not a challenge! I really don't understand this stuff, I've always found javascript dependency management very confusing.
I appreciate the clarification but it was clear to me the question was sincere FWIW! And yeah, a lot of this was hard for me to get a solid grasp on for quite a while. I think this tends to show up more in the JS ecosystem because semver was so eagerly adopted there, but I suspect it’s of similar benefit where semver is used and dev/prod dependencies is a proscribed distinction generally.
For example if you have a dependency with a peerDependency `something: 2.x.x` and you currently have `something: 1.0.0` installed as a direct dependency, it will fail rather than allowing multiple versions to be run.
Peer dependencies added more problems than they solved in my eyes... Most peer dependencies warnings come because some maintainer forgot to update the package.json and not really because two packages don't work with each other...