diff options
author | isaacs <i@izs.me> | 2012-02-29 04:19:20 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-02-29 04:19:20 +0400 |
commit | 317d86727e55dbefbf8f69880c1280b1578ee660 (patch) | |
tree | 39cfd31f691b1ebcc2f4a16ca2bca2b681075af1 | |
parent | 42ef568be733135a5a27f838031dc7e115cac8f6 (diff) |
Log an info when something is skipped
-rw-r--r-- | lib/install.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/install.js b/lib/install.js index b493775c1..add5d5aa7 100644 --- a/lib/install.js +++ b/lib/install.js @@ -469,6 +469,7 @@ function targetResolver (where, context, deps) { if (!alreadyInstalledManually) return setTimeout(function () { resolver(what, cb) }, to++) + // now we know what's been installed here manually, // or tampered with in some way that npm doesn't want to overwrite. if (alreadyInstalledManually.indexOf(what.split("@").shift()) !== -1) { @@ -479,6 +480,7 @@ function targetResolver (where, context, deps) { // check for a version installed higher in the tree. // If installing from a shrinkwrap, it must match exactly. if (context.family[what]) { + if (wrap && wrap[what].version == context.family[what]) { log.verbose("using existing "+what+" (matches shrinkwrap)") return cb(null, []) @@ -504,11 +506,16 @@ function targetResolver (where, context, deps) { cache.add(what, function (er, data) { if (er && parent && parent.optionalDependencies && - parent.optionalDependencies.hasOwnProperty(what.split("@").shift())) { + parent.optionalDependencies.hasOwnProperty(what.split("@")[0])) { log.warn(what, "optional dependency failed, continuing") return cb(null, []) } - if (!er && data && context.family[data.name] === data.version) { + + if (!er && + data && + context.family[data.name] === data.version && + !npm.config.get("force")) { + log.info(data.name + "@" + data.version, "already installed") return cb(null, []) } return cb(er, data) |