diff options
Diffstat (limited to 'deps/npm/lib')
-rw-r--r-- | deps/npm/lib/install.js | 11 | ||||
-rw-r--r-- | deps/npm/lib/utils/config-defs.js | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 91909a6638..fc1c26aaf0 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -127,7 +127,15 @@ function install (args, cb_) { , explicit: false , parent: data , wrap: null } - context.family[data.name] = context.ancestors[data.name] = data.version + + if (data.name === path.basename(where) && + path.basename(path.dirname(where)) === "node_modules") { + // Only include in ancestry if it can actually be required. + // Otherwise, it does not count. + context.family[data.name] = + context.ancestors[data.name] = data.version + } + installManyTop(deps.map(function (dep) { var target = data.dependencies[dep] , parsed = url.parse(target.replace(/^git\+/, "git")) @@ -177,6 +185,7 @@ function readDependencies (context, where, opts, cb) { if (er) return cb(er) if (opts && opts.dev) { + if (!data.dependencies) data.dependencies = {}; Object.keys(data.devDependencies || {}).forEach(function (k) { data.dependencies[k] = data.devDependencies[k] }) diff --git a/deps/npm/lib/utils/config-defs.js b/deps/npm/lib/utils/config-defs.js index f7f01462ff..bb277efdea 100644 --- a/deps/npm/lib/utils/config-defs.js +++ b/deps/npm/lib/utils/config-defs.js @@ -161,7 +161,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , parseable : false , pre: false , prefix : globalPrefix - , production: false + , production: process.env.NODE_ENV === "production" , "proprietary-attribs": true , proxy : process.env.HTTP_PROXY || process.env.http_proxy || null , "https-proxy" : process.env.HTTPS_PROXY || process.env.https_proxy || |