无法安装 node-glfw:找不到包 'glfw3'

Unable to Install node-glfw: No package 'glfw3' found

尝试在我的 centos 6 机器上安装 node-glfw 时出现以下错误。 我已经将 PKG_CONFIG_PATH 设置为 /usr/local/lib/pkgconfig/glfw3.pc

错误如下:

npm http GET https://registry.npmjs.org/node-glfw
npm http 304 https://registry.npmjs.org/node-glfw
npm WARN engine node-glfw@0.3.1: wanted: {"node":"0.6.5-0.11.10"}  (current: >{"node":"v0.10.33","npm":"1.3.6"})
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/nan

node-glfw@0.3.1 install /home/ingole/node_modules/node-glfw
node-gyp rebuild

Package glfw3 was not found in the pkg-config search path.
Perhaps you should add the directory containing glfw3.pc' to the PKG_CONFIG_PATH environment variable No package 'glfw3' found Traceback (most recent call last): File "/usr/bin/gyp", line 18, in <module> sys.exit(gyp.main(sys.argv[1:])) File "/usr/lib/python2.6/site-packages/gyp/__init__.py", line 462, in main options.circular_check) File "/usr/lib/python2.6/site-packages/gyp/__init__.py", line 100, in Load depth, generator_input_info, check, circular_check) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 2255, in Load depth, check) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 388, in LoadTargetBuildFile build_file_path) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 1011, in ProcessVariablesAndConditionsInDict build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 1026, in ProcessVariablesAndConditionsInList ProcessVariablesAndConditionsInDict(item, is_late, variables, build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 985, in ProcessVariablesAndConditionsInDict ProcessConditionsInDict(the_dict, is_late, variables, build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 862, in ProcessConditionsInDict variables, build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 1011, in ProcessVariablesAndConditionsInDict build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 1030, in ProcessVariablesAndConditionsInList expanded = ExpandVariables(item, is_late, variables, build_file) File "/usr/lib/python2.6/site-packages/gyp/input.py", line 697, in ExpandVariables (contents, p.returncode)) Exception: Call to 'pkg-config --libs glfw3 glew' returned exit status 1. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error:gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:428:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 2.6.32-431.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ingole/node_modules/node-glfw
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

如果您在 github 上查看关于 node-glfw 的问题,则会发现一个未解决的问题

PKG_CONFIG_PATH应该是这样的:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

并没有 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/glfw3.pc

之后, npm install node-glfw 为我工作