nclosure与nodejs 0.12不兼容

时间:2015-04-01 13:11:27

标签: node.js google-closure

nclosure,NodeJs服务器端的Google Closure Lib,与nodejs 0.12不兼容

与nodejs 0.12

兼容
/node_modules/nclosure/lib/settingsloader.js:102
  if (!path || !require('path').existsSync(path)) return null;
                                ^
TypeError: undefined is not a function
    at nclosure.settingsLoader.readArgsFromJSONFile (/home/wj/work/transport/node_modules/nclosure/lib/settingsloader.js:102:33)
    at nclosure.settingsLoader.readSettingsObject (/node_modules/nclosure/lib/settingsloader.js:133:12)
    at nclosure.base.loadBaseScript_ (/node_modules/nclosure/lib/nclosurebase.js:199:53)
    at new nclosure.base (/node_modules/nclosure/lib/nclosurebase.js:69:10)
    at Object.<anonymous> (/node_modules/nclosure/lib/nclosurebase.js:350:24)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

{1}} lib在nodejs 0.12中不再存在?如何解决?

1 个答案:

答案 0 :(得分:0)

它不应该是require('path'),而是require('fs'),因为 existsSync 功能位于 fs API中。你可以分叉这个库并修复它。