1

我正在尝试在 Mac OS X 上安装 mysql 节点包。我正在尝试在本地运行客户端项目。

我已经安装了 node 和 npm,它们工作正常,其他软件包也安装得很好。我还编译/安装了完整的 LAMP 堆栈。

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

有什么建议吗?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
4

1 回答 1

1

查看 README 和问题 #107 中的依赖项部分。要构建 mysql-libmysqlclient,您应该为其安装 libmysqlclient 和开发头文件,将 MySQL bin 目录的路径添加到 $PATH 并将 MySQL lib 目录的路径添加到 $DYLD_LIBRARY_PATH。

于 2012-05-17T19:11:40.807 回答