diff options
author | isaacs <i@izs.me> | 2014-03-19 09:25:40 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-03-19 09:26:05 -0700 |
commit | a65c1aaf3afe21a34cae7b4ad266a6f2723704d1 (patch) | |
tree | 61e4c2a3b069f78d8ef5ae635a887cda13ec1c15 /deps/npm/lib/install.js | |
parent | 43a29f53ca11ab48e1d1ef6b2a0e673ae43a42a0 (diff) | |
download | node-npm-1.4.6.tar.gz |
npm: upgrade to 1.4.6npm-1.4.6
Diffstat (limited to 'deps/npm/lib/install.js')
-rw-r--r-- | deps/npm/lib/install.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 92a490785..39c98ecff 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -74,6 +74,7 @@ var npm = require("./npm.js") , archy = require("archy") , isGitUrl = require("./utils/is-git-url.js") , npmInstallChecks = require("npm-install-checks") + , sortedObject = require("sorted-object") function install (args, cb_) { var hasArguments = !!args.length @@ -187,7 +188,7 @@ function install (args, cb_) { } function findPeerInvalid (where, cb) { - readInstalled(where, { log: log.warn }, function (er, data) { + readInstalled(where, { log: log.warn, dev: true }, function (er, data) { if (er) return cb(er) cb(null, findPeerInvalid_(data.dependencies, [])) @@ -350,7 +351,8 @@ function save (where, installed, tree, pretty, hasArguments, cb) { return w }).reduce(function (set, k) { var rangeDescriptor = semver.valid(k[1], true) && - semver.gte(k[1], "0.1.0", true) + semver.gte(k[1], "0.1.0", true) && + !npm.config.get("save-exact") ? "^" : "" set[k[0]] = rangeDescriptor + k[1] return set @@ -378,7 +380,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) { var bundle = data.bundleDependencies || data.bundledDependencies delete data.bundledDependencies if (!Array.isArray(bundle)) bundle = [] - data.bundleDependencies = bundle + data.bundleDependencies = bundle.sort() } log.verbose('saving', things) @@ -391,6 +393,8 @@ function save (where, installed, tree, pretty, hasArguments, cb) { } }) + data[deps] = sortedObject(data[deps]) + data = JSON.stringify(data, null, 2) + "\n" fs.writeFile(saveTarget, data, function (er) { cb(er, installed, tree, pretty) |