Question

So I am just starting out with node and npm on Mountain Lion, and have been following the Node Up and Running book to work with databases (http://chimera.labs.oreilly.com/books/1234000001808/ch06.html#mysql).

When I tried sudo npm install -g db-mysql I get this message:

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.

I've tried seeing if others have run into this. Most of the answers I've found have been focused on other installs (During npm install socket.io I get error 127, node-waf command not found. How to solve it?), directed to Ubuntu (or Windows) users or simply advocate installing the mysql driver (How to install nodejs modules on windows7?).

The closest I've gotten is this solution in the project's issue thread, to just clone the source and replace node-waf with node-gyp: https://github.com/mariano/node-db-mysql/issues/98. However the thread was started for ArchLinux, and a user ran into an error on Mountain Lion at the last step of the solution.

Is there a significant difference between the db-mysql and mysql drivers in practice? Are these the only options? If there is a reason to use db-mysql, how can I solve this install issue on Mountain Lion?

Was it helpful?

Solution

I am choosing node-mysql as the driver instead, I've found:

  1. It's up to date, easier to install (https://github.com/felixge/node-mysql)

  2. It works with the latest version MySQL cluster too, although MySQL cluter v7.3.1 and below use node-waf rather than node-gyp (https://dev.mysql.com/doc/ndbapi/en/ndb-nodejs-setup.html)

  3. It supports collection pooling (node-mysql connection pooling)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top