npm包构build失败,如何最好的debugging?

我试图在Mac OS X上安装一个MySQL节点包。我试图在本地运行一个客户端项目。

我已经安装了节点和npm,它们工作正常,其他包已经安装好了。 我也编译/安装了完整的LAMP堆栈。

当下面的构build失败时,我没有看到任何有用的错误消息 – 只是关于找不到的库的信息。 不知道它找不到,我无法修复它。

有什么build议? MySQL已经安装了标准的方式 – 下载包,./configure,d,make / install。

$ npm install mysql-libmysqlclient npm http GET https://registry.npmjs.org/mysql-libmysqlclient npm http 304 https://registry.npmjs.org/mysql-libmysqlclient > mysql-libmysqlclient@1.3.3 install /Users/botskonet/node_modules/mysql-libmysqlclient > node-gyp rebuild info it worked if it ends with ok spawn python [ '/Users/botskonet/.node-gyp/0.6.12/tools/gyp_addon', 'binding.gyp', '-I/Users/botskonet/node_modules/mysql-libmysqlclient/build/config.gypi', '-f', 'make' ] spawn make [ 'BUILDTYPE=Release', '-C', 'build' ] CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings.o CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_connection.o CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_result.o CXX(target) Release/obj.target/mysql_bindings/src/mysql_bindings_statement.o SOLINK_MODULE(target) Release/mysql_bindings.node ld: library not found for -lmysqlclient_r collect2: ld returned 1 exit status make: *** [Release/mysql_bindings.node] Error 1 ERR! Error: `make` failed with exit code: 2 at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:176:25) at EventEmitter._tickCallback (node.js:192:40) ERR! not ok npm ERR! mysql-libmysqlclient@1.3.3 install: `node-gyp rebuild` npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1 npm ERR! npm ERR! Failed at the mysql-libmysqlclient@1.3.3 install script. npm ERR! This is most likely a problem with the mysql-libmysqlclient package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls mysql-libmysqlclient npm ERR! There is likely additional logging output above. npm ERR! npm ERR! System Darwin 11.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "mysql-libmysqlclient" npm ERR! cwd /Users/botskonet/Sites/SportsBuddies npm ERR! node -v v0.6.12 npm ERR! npm -v 1.1.15 npm ERR! code ELIFECYCLE npm ERR! message mysql-libmysqlclient@1.3.3 install: `node-gyp rebuild` npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1 npm ERR! errno {} npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/botskonet/Sites/SportsBuddies/npm-debug.log npm not ok 

阅读README中的依赖关系部分,然后问题#107。 要构buildmysql-libmysqlclient,你应该为它安装libmysqlclient和开发头文件,将你的MySQL bin目录的path添加到$ PATH,并将你的MySQL lib目录的path添加到$ DYLD_LIBRARY_PATH。