node gh出现问题,通常可能是node.js安装
我是node.js开发的新手。我最近安装了npm/node.js并安装了node-gh应用程序 加载时,会出现以下错误:node gh出现问题,通常可能是node.js安装,node.js,github-api,Node.js,Github Api,我是node.js开发的新手。我最近安装了npm/node.js并安装了node-gh应用程序 加载时,会出现以下错误: gh [success] Authentication succeed. gh [success] Writing GH config data: /Users/esteban/.gh.json fs.js:665 return binding.readdir(pathModule._makeLong(path)); ^ Error:
gh [success] Authentication succeed.
gh [success] Writing GH config data: /Users/esteban/.gh.json
fs.js:665
return binding.readdir(pathModule._makeLong(path));
^
Error: ENOENT, no such file or directory '/usr/local/Cellar/node/0.10.32/lib/node_modules'
at Object.fs.readdirSync (fs.js:665:18)
at Object.exports.getPlugins (/usr/local/lib/node_modules/gh/lib/base.js:250:18)
at exports.checkVersion (/usr/local/lib/node_modules/gh/lib/base.js:176:27)
at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:551:21
at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:227:13
at iterate (/usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:134:13)
at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:145:25
at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:229:17
at /usr/local/lib/node_modules/gh/node_modules/async/lib/async.js:556:34
at /usr/local/lib/node_modules/gh/lib/git.js:119:9
```
我的路径可能有问题吗?多谢各位
编辑:代码来自/usr/local/lib/node_modules/gh/lib/base.js的246-260:
exports.getPlugins = function() {
var nodeModulesPath = exports.getNodeModulesGlobalPath(),
plugins;
plugins = fs.readdirSync(nodeModulesPath).filter(function(plugin) {
return plugin.substring(0, 3) === 'gh-';
});
return plugins;
};
exports.getPluginBasename = function(plugin) {
return plugin && plugin.replace('gh-', '');
};
检查该文件夹及其文件的权限。请确保您正在运行node的用户可以看到它们。我在OS X上,我也尝试过以sudo的身份运行应用程序,但运气不好……您能从堆栈跟踪的起始行发布节点代码吗?如果这不是权限问题的话,这可能会带来一些启示。我也会尝试npm过时,看看你是否有任何过时的模块,并确保你在最新的节点上,以防这是一个可能已经解决的模块冲突。如果不使用自制程序安装Node,而只使用常规的Node安装程序,那么它可能会起作用。