diff options
author | Yazhong Liu <yorkiefixer@gmail.com> | 2014-01-10 11:47:40 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-02-17 05:16:55 +0400 |
commit | 8ebe852c8f185f76eec00b24796bd96a1d76be4d (patch) | |
tree | 1b365395cb27d4c986af3b063ff3def8226c6901 /lib/npm.js | |
parent | d4f6f3ff83bd14fb60d3ac6392cb8eb6b1c55ce1 (diff) |
more legible error message in config.get/set
Test added by @isaacs
Closes #4458
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/npm.js b/lib/npm.js index 858a5e8c4..7b3826290 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -31,7 +31,15 @@ var EventEmitter = require("events").EventEmitter , chain = slide.chain , RegClient = require("npm-registry-client") -npm.config = {loaded: false} +npm.config = { + loaded: false, + get: function() { + throw new Error('npm.load() required') + }, + set: function() { + throw new Error('npm.load() required') + } +} // /usr/local is often a read-only fs, which is not // well handled by node or mkdirp. Just double-check |