2

I'm trying to figure out a peer dependency issue and everything looks fine to me...

My package.json has:

, "devDependencies" : {
    "gulp-watchify" : "^0.2.0"
    ,    "watchify" : "^0.10.2"
}

And gulp-watchify/package.json has:

"peerDependencies": {
    "watchify": "^0.6.1"
},

0.10.2 staisfies ^0.6.1, no? So why is npm complaining:

npm ERR! peerinvalid The package watchify does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer gulp-watchify@0.2.0 wants watchify@^0.6.1

npm ERR! System Darwin 14.0.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd <path redacted>
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     <path redacted>/npm-debug.log
npm ERR! not ok code 0

???

2 Answers2

7

The reason here is 0.10.2 does not actually satisfy ^0.6.1, since 0.X.X versions are a special semver category of unstable versions. Moving from 0.1.X to 0.2.X indicates a breaking change, so they are not compatible. From the semver docs:

^0.1.3 := >=0.1.3-0 <0.2.0-0 "Compatible with 0.1.3". 0.x.x versions are special: the first non-zero component indicates potentially breaking changes, meaning the caret operator matches any version with the same first non-zero component starting at the specified version.

To fix this you can either remove your dependency on watchify, or set it to something along the 0.6.X release line, such as:

, "devDependencies" : {
    "gulp-watchify" : "^0.2.0"
    ,    "watchify" : "^0.6.4"
}
dylants
  • 22,316
  • 3
  • 26
  • 22
  • gah, I hate when people decided to have multiple meanings for the same thing at multiple times. Thanks for this :) –  Jun 18 '14 at 21:04
  • Yeah, I think most people don't know about this (including those who develop projects and use the 0.X versions). But it's kinda nice once you know about it, to use it in early development. Really those who have a stable product should switch to 1.X and above. – dylants Jun 18 '14 at 21:40
0

I remember this was an issue with version incompatibilities a while back. Here is a stack with a similar dependencies issue with an answer that should help figure out where your dependencies are breaking. Granted it was for grunt dependencies:

grunt-dependencies

Community
  • 1
  • 1
ZekeDroid
  • 7,089
  • 5
  • 33
  • 59