mysql/mysql-js

Failure to install on Mac

uhop opened this issue · 5 comments

uhop commented

For some reasons I cannot install mysql-js on Mac (abbreviated):

$ npm install --save https://github.com/mysql/mysql-js/archive/2014-10-06.tar.gz
/
> mysql-js@0.7.3 preinstall /Users/elazutkin/work/kangaroo/server-poc/node_modules/mysql-js
> node configure && node-gyp rebuild -d

#
#                 MySQL Cluster NoSQL API for Node.JS
#  April, 2013
[...snipped...]
MySQL Install Path> /usr/local/Cellar/mysql/5.6.24

Now run this command:
    node-gyp configure build -d
  CXX(target) Debug/obj.target/ndb_adapter/Adapter/impl/common/src/async_common.o
  CXX(target) Debug/obj.target/ndb_adapter/Adapter/impl/common/src/unified_debug.o
  CXX(target) Debug/obj.target/ndb_adapter/Adapter/impl/common/src/common_v8_values.o
  CXX(target) Debug/obj.target/ndb_adapter/Adapter/impl/ndb/src/AsyncNdbContext_wrapper.o
In file included from ../Adapter/impl/ndb/src/AsyncNdbContext_wrapper.cpp:21:
../Adapter/impl/ndb/include/AsyncNdbContext.h:21:10: fatal error: 'NdbApi.hpp' file not found
#include <NdbApi.hpp>
         ^
1 error generated.
make: *** [Debug/obj.target/ndb_adapter/Adapter/impl/ndb/src/AsyncNdbContext_wrapper.o] Error 1
[...snipped...]

The problem appears to be in the adapter code (?), which pulls in a non-existent NdbApi.hpp, which probably belongs to an ndb-cluster installation, while I have a MySQL Server 5.6.24 installed with brew.

The same bug exists when trying a current version of the repo.

The above is a failure with node.js 0.10. The current stable version of node.js is 0.12, which fails with numerous bugs related to different internals. It looks like the code of mysql-js was not updated to support new V8.

Just to stave off possible questions: I do not intend to use Mac as a deployment platform, but I want to use it as a development environment, and as such I expect that I can develop mysql-js-based web applications. If certain configurations are purposely not supported, please list them explicitly.

Hi,
This particular error is related to building the NDB adapter. If you do plan to use MySQL Cluster, I'd suggest getting a MySQL Cluster release (7.4) rather than MySQL 5.6. If you don't plan to use MySQL Cluster, you don't need the NDB adapter, so you can ignore the error.
If you check out the "all-jones" branch from github, you will see our future direction where I think this distinction is a lot cleaner.

uhop commented

For now I want to use MySQL 5.6 for simplicity. But while I do ignore the error, npm doesn't and it doesn't install mysql-js as a dependency. What is the exact recipe to install it? I can do it manually, but it would be nice to know the "official" steps.

uhop commented

I just copied the tarball manually, uncompressed it to node_modules/, renamed to mysql-js, then ran npm install in it, just to fail (see the original bug report above). Like you said it appears to be working. I hope the overall developer experience will be improved, and the module will be submitted to npm.

I looked at all-jones branch and it looks better decoupled. Way to go!

I am leaving this ticket open, so you can close it when the problem is resolved. Meanwhile I hope it'll serve as a reference for developers having the same problem as I did.

Just an update: as of this morning we have merged all-jones into master.

uhop commented

I tried the new version and it works for me. Thanks!

I cloned the repository and copied relevant modules manually to node_modules/: database-jones, jones-mysql, jones-promises, unified_debug.

BTW, I've noticed that jones-promises declared (unsatisfied) dependencies on jones-test and promises-aplus-tests, which are unlikely needed for an actual deployment. Shouldn't they be moved to devDependencies section of package.json?

Nevertheless the problem is solved by a more modular design, and I am closing the issue.