Nodejs配置错误

时间:2014-09-26 17:26:21

标签: node.js config

我已经在各种脚本中使用配置模块半年了将近一年。现在突然配置抛出错误抱怨我没有方法watchForConfigFileChanges();有谁知道这个或如何解决这个问题?我使用节点v0.10.31和来自npm的最新版本的config。我应该在某处添加此方法吗?我搞不清楚了。以下是终端输出:

isaacs-air:NU isaacflaum$ node bin/test.js 

/Users/isaacflaum/Code/Forensiq/NU/node_modules/config/lib/config.js:1185
global.NODE_CONFIG.watchForConfigFileChanges();
                   ^
TypeError: Object {

    "reportingDb": {
        "user" : "isaac",
        "password" : "whatIfThisIsActuallyMyPassword?"
    },

    "bingAPI": {
        "user"  : "user",
        "password" : ""
    }

}

 has no method 'watchForConfigFileChanges'
    at Object.<anonymous> (/Users/isaacflaum/Code/Forensiq/NU/node_modules/config/lib/config.js:1185:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/isaacflaum/Code/Forensiq/NU/bin/test.js:17:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

0 个答案:

没有答案