title: Do any programming languages or package managers support coherence/confluence/global uniqueness of installed packages?
body: <p>When <a href="https://www.npmjs.com/" rel="nofollow noreferrer">npm</a> installs packages, it produces a tree of dependencies, where each package in the tree has its own tree of dependencies. As a result, the same package may occur in the tree multiple times. When obtaining an object that is re-exported through transitive dependencies, different objects may be returned based on the specific path of exports that were followed.</p>
  <p>This causes problems in some cases, so <a href="https://nodejs.org/en/blog/npm/peer-dependencies/" rel="nofollow noreferrer">peer dependencies</a> exist, which allow the top-level of an application to specify a single version of a package, which sub-dependencies share in common.</p>
  <p>If every dependency were marked as a <code>peerDependency</code>, then a single, global version of each package would exist in an application.</p>
  <p>My question is: are there any languages or package managers which enforce a similar behavior everywhere, such that any two packages which share a dependency will share the exact same version of this dependency? And as a bonus, what costs or benefits have said languages/ecosystems encountered as a result of this?</p>