diff options
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/npm.js b/lib/npm.js index f2319bfd5..344e4d348 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -275,6 +275,8 @@ npm.load = function (cli, cb_) { function cb (er) { if (loadErr) return + loadErr = er + if (er) return cb_(er) if (npm.config.get("force")) { log.warn("using --force", "I sure hope you know what you are doing.") } @@ -307,6 +309,9 @@ function load (npm, cli, cb) { npmconf.load(cli, builtin, function (er, config) { if (er === config) er = null + npm.config = config + if (er) return cb(er) + // Include npm-version and node-version in user-agent var ua = config.get("user-agent") || "" ua = ua.replace(/\{node-version\}/gi, process.version) @@ -315,8 +320,6 @@ function load (npm, cli, cb) { ua = ua.replace(/\{arch\}/gi, process.arch) config.set("user-agent", ua) - npm.config = config - var color = config.get("color") log.level = config.get("loglevel") |