【问题标题】:MySQL driver for NodeDB: db-mysql gives node waf error on Mountain LionNodeDB 的 MySQL 驱动程序:db-mysql 在 Mountain Lion 上给出节点 waf 错误
【发布时间】:2013-12-21 23:51:00
【问题描述】:

所以我刚开始在 Mountain Lion 上使用 node 和 npm,并且一直在关注 Node Up and Running 这本书来使用数据库 (http://chimera.labs.oreilly.com/books/1234000001808/ch06.html#mysql)。

当我尝试 sudo npm install -g db-mysql 时,我收到以下消息:

npm ERR! db-mysql@0.7.6 install: `node-waf configure build`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the db-mysql@0.7.6 install script.
npm ERR! This is most likely a problem with the db-mysql package,
npm ERR! not with npm itself.

我试过看看其他人是否遇到过这种情况。我发现的大多数答案都集中在其他安装(During npm install socket.io I get error 127, node-waf command not found. How to solve it?)上,针对 Ubuntu(或 Windows)用户,或者只是提倡安装 mysql 驱动程序(How to install nodejs modules on windows7?)。

我得到的最接近的是项目问题线程中的这个解决方案,只需克隆源并将 node-waf 替换为 node-gyp:https://github.com/mariano/node-db-mysql/issues/98。但是该线程是为 ArchLinux 启动的,用户在解决方案的最后一步遇到了 Mountain Lion 的错误。

db-mysql 和 mysql 驱动程序在实践中是否存在显着差异?这些是唯一的选择吗?如果有理由使用 db-mysql,我该如何解决 Mountain Lion 上的安装问题?

【问题讨论】:

  • 该驱动程序已过时,恐怕不再适用于最新的 Node 版本。还有其他驱动程序,例如node-mysql,但它们的语义将不同于db-mysql
  • 好的,谢谢!我对不同驱动程序的性能差异和池功能感到好奇,但从我的研究来看,node-mysql 看起来不错,所以我可能会继续这样做。

标签: mysql node.js osx-mountain-lion npm


【解决方案1】:

我选择 node-mysql 作为驱动程序,我发现:

  1. 它是最新的,更易于安装 (https://github.com/felixge/node-mysql)

  2. 它也适用于最新版本的 MySQL 集群,尽管 MySQL cluter v7.3.1 及更低版本使用 node-waf 而不是 node-gyp (https://dev.mysql.com/doc/ndbapi/en/ndb-nodejs-setup.html)

  3. 支持集合池化(node-mysql connection pooling

【讨论】:

    猜你喜欢
    • 2014-06-30
    • 2013-01-02
    • 2017-05-23
    • 2014-10-24
    • 2012-08-03
    • 1970-01-01
    • 1970-01-01
    • 2014-02-15
    • 1970-01-01
    相关资源
    最近更新 更多