You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a .defaults call in the chain causes save to fail with an exception as below. The same happens with either .env or .argv present. The examples seem to indicate this should be a valid way to use nconf.
jb@jborg-mbp:~/tmp % npm list
/Users/jb/tmp
└─┬ nconf@0.5.1
├── async@0.1.22
├── ini@1.0.2
├─┬ optimist@0.3.4
│ └── wordwrap@0.0.2
└── pkginfo@0.2.3
jb@jborg-mbp:~/tmp % cat test.js
var nconf = require('nconf');
nconf.file({ file: 'settings.json' });
nconf.defaults({
foo: 'bar'
});
nconf.save();
jb@jborg-mbp:~/tmp % node test.js
/Users/jb/tmp/node_modules/nconf/lib/nconf/common.js:96
Object.keys(obj).forEach(function (key) {
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at /Users/jb/tmp/node_modules/nconf/lib/nconf/common.js:96:12
at Array.forEach (native)
at Object.merge (/Users/jb/tmp/node_modules/nconf/lib/nconf/common.js:95:8)
at [object Object].save (/Users/jb/tmp/node_modules/nconf/lib/nconf/provider.js:425:19)
at Object.<anonymous> (/Users/jb/tmp/test.js:6:7)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
The text was updated successfully, but these errors were encountered:
Having a
.defaults
call in the chain causes save to fail with an exception as below. The same happens with either.env
or.argv
present. The examples seem to indicate this should be a valid way to use nconf.The text was updated successfully, but these errors were encountered: