diff options
Diffstat (limited to 'deps/npm/node_modules/read-installed/read-installed.js')
-rw-r--r-- | deps/npm/node_modules/read-installed/read-installed.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js index 192907c26c..4babfc862a 100644 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ b/deps/npm/node_modules/read-installed/read-installed.js @@ -121,8 +121,6 @@ function readInstalled (folder, depth, cb) { var rpSeen = {} function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) { - //console.error(folder, name) - var installed , obj , real @@ -251,6 +249,7 @@ function resolveInheritance (obj) { Object.keys(obj.dependencies).forEach(function (dep) { resolveInheritance(obj.dependencies[dep]) }) + findUnmet(obj) } // find unmet deps by walking up the tree object. @@ -261,6 +260,7 @@ function findUnmet (obj) { fuSeen.push(obj) //console.error("find unmet", obj.name, obj.parent && obj.parent.name) var deps = obj.dependencies = obj.dependencies || {} + //console.error(deps) Object.keys(deps) .filter(function (d) { return typeof deps[d] === "string" }) @@ -297,8 +297,21 @@ function findUnmet (obj) { var peerDeps = obj.peerDependencies = obj.peerDependencies || {} Object.keys(peerDeps).forEach(function (d) { - var dependency = obj.parent && obj.parent.dependencies && - obj.parent.dependencies[d] + var dependency + + if (!obj.parent) { + dependency = obj.dependencies[d] + + // read it as a missing dep + if (!dependency) { + obj.dependencies[d] = peerDeps[d] + } + } else { + dependency = obj.parent.dependencies && obj.parent.dependencies[d] + } + + if (!dependency) return + dependency.extraneous = false if (!semver.satisfies(dependency.version, peerDeps[d])) { |