request
version 2 and some-other-library
, but some-other-library
depends on request
version 1, the resultingdependency graph looks like:some-other-library
has its own copy of request
v1 that it can use, while notinterfering with my package's v2 copy. Everyone's code works!<script>
s you would drop into your page that would attach things to jQuery.prototype
for your later convenience.chai-as-promised
plugin work withchai
version 0.5, whereas versions 3.x work with chai
1.x. Or, in the faster-paced and less-semver–friendly world ofGrunt plugins, version 0.3.1 of grunt-contrib-stylus
works with grunt
0.4.0rc4, but breaks when used with grunt
0.4.0rc5 due to removed APIs.'dependencies'
hash in package.json
, clearly falls down for plugins. Most plugins never actuallydepend on their host package, i.e. grunt plugins never do require('grunt')
, so even if plugins did put down their hostpackage as a dependency, the downloaded copy would never be used. So we'd be back to square one, with your applicationpossibly plugging in the plugin to a host package that it's incompatible with.package.json
would result in a dependency tree with multiple copies of thehost package—not what you want. For example, let's pretend that winston-mail
0.2.3 specified 'winston': '0.5.x'
inits 'dependencies'
hash, since that's the latest version it was tested against. As an app developer, you want thelatest and greatest stuff, so you look up the latest versions of winston
and of winston-mail
, putting them in yourpackage.json
asnpm install
results in the unexpected dependency graph ofjitsu
0.11.6 with npm1.2.10:jitsu
Fallout 4 radio mod not working. depends on two Flatiron-related packages, which themselves peer-depend on conflicting versionsof Flatiron. Good thing npm was around to help us figure out this conflict, so it could be fixed in version 0.11.7!package.json
:chai-as-promised
, the chai
package will come along with it. And if later you try to installanother Chai plugin that only works with 0.x versions of Chai, you'll get an error. Nice!'~1.0'
or '1.x'
to express this. If you depend onfeatures introduced in 1.5.2, use '>= 1.5.2 < 2'
.