【发布时间】: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