node-gyp:gyp ERR! 无法加载共享的libpython2.7.so.1.0

我正在尝试为节点js构buildhello world c ++插件。 node.js和node-gyp似乎都已成功安装到redhat linux中。 但是当我运行“node-gyp configure”时,它给出了以下错误。 我没有通过gooling和wiki页面获得任何有见地的信息。 你能恳请build议吗?

我从源代码构build了Python并进行了自定义安装。 下面是libpython2.7.so.1.0:$ PYTHONPATH以及$ LD_LIBRARY_PATH。 节点或节点gypsearch一个相当不同的环境可以共享库吗?

提前致谢。

堆栈错误:

~/examples/node.js/my_node_addon-1[13:14]% node-gyp configure gyp info it worked if it ends with ok gyp info using node-gyp\@0.10.10 gyp info using node\@0.10.18 | linux | x64 gyp ERR! configure error gyp ERR! stack Error: Command failed: python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory gyp ERR! stack gyp ERR! stack at ChildProcess.exithandler (child_process.js:637:15) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at maybeClose (child_process.js:735:16) gyp ERR! stack at Socket.<anonymous> (child_process.js:948:11) gyp ERR! stack at Socket.EventEmitter.emit (events.js:95:17) gyp ERR! stack at Pipe.close (net.js:466:12) gyp ERR! System Linux 2.6.18-194.32.1.el5 gyp ERR! command "node" "/work/dengf/conf/bin/node-gyp" "configure" gyp ERR! cwd /home/dengf/examples/node.js/my_node_addon gyp ERR! node -v v0.10.18 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok 

但是当我单独运行python时,它加载共享库就好了:

 ~/examples/node.js/my_node_addon-1[13:14]% python -V Python 2.7.3 

另外,我的binding.gyp如下:

 { 'targets': [ { 'target_name': 'hello', 'sources': [ 'src/hello.cc' ], 'include_dirs': ['/path/to/my/include'], 'link_settings': { 'library_dirs': [ '/path/to/my/libpython2.7.so.1.0' ] } } ] } 

最后,连续跟踪和debugging2天后,我进行了sorting。 但是,我不确定这是否是由于我自定义的Python安装。 我在〜node_modules / node-gyp / lib / configure.js中更新了下面的代码(原来的注释改为93到94:

 93 // var env = { TERM: 'dumb', PATH: process.env.PATH}; 94 var env = process.env; 

我真的很感激团队中的任何一个node.js专家能否对上述变化有理性的帮助?

我也在谷歌组nodejs上发布了这个问题,所以FYI。

再次感谢冯