Permalink
Browse files

default to ^ instead of ~

  • Loading branch information...
1 parent acc4d02 commit 0a3151c9cbeb50c1c65895685c2eabdc7e2608dc @mikolalysenko mikolalysenko committed with isaacs Feb 2, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/install.js
View
@@ -351,7 +351,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
}).reduce(function (set, k) {
var rangeDescriptor = semver.valid(k[1], true) &&
semver.gte(k[1], "0.1.0", true)
- ? "~" : ""
+ ? "^" : ""
set[k[0]] = rangeDescriptor + k[1]
return set
}, {})

1 comment on commit 0a3151c

This format doesn't seem to be documented at https://www.npmjs.org/doc/files/package.json.html and I just fell foul of this as it broke backward compatibility with node 0.8 for some libraries that I just updated with new dependencies. Basically this change means that if I update any libraries using npm install --save they will no longer be compatible with 0.8 unless I manually change it back to ~

I think at least it should be documented before making it default or am i looking in the wrong place for documentation.

Sorry to be complainy ;)

Please sign in to comment.