Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-03-13 23:31:23 +0400
committerisaacs <i@izs.me>2012-03-13 23:31:23 +0400
commitcf464f658cccc1534fc12835db5575ee1ed28150 (patch)
tree3e3e0653465170f2593a12efb75b1ca3eb2f36d6
parent565ec289a2f7cf5c5d09a529242cb9f47c858b69 (diff)
Always assume bundleDependencies are valid in 'install <noargs>'
-rw-r--r--lib/install.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/install.js b/lib/install.js
index 42ef2385c..ae10965cb 100644
--- a/lib/install.js
+++ b/lib/install.js
@@ -464,10 +464,18 @@ function targetResolver (where, context, deps) {
if (er) return alreadyInstalledManually = []
asyncMap(inst, function (pkg, cb) {
readJson(path.resolve(nm, pkg, "package.json"), function (er, d) {
+ // error means it's not a package, most likely.
if (er) return cb(null, [])
- if (semver.satisfies(d.version, deps[d.name] || "*")) {
+
+ // if it's a bundled dep, then assume that anything there is valid.
+ // otherwise, make sure that it's a semver match with what we want.
+ var bd = parent.bundleDependencies
+ if (bd && bd.indexOf(d.name) !== -1 ||
+ semver.satisfies(d.version, deps[d.name] || "*")) {
return cb(null, d.name)
}
+
+ // something is there, but it's not satisfactory. Clobber it.
return cb(null, [])
})
}, function (er, inst) {