mariano / node-db-mysql

MySQL database bindings for Node.js
http://nodejsdb.org
150 stars 30 forks source link

build issues on node >0.6.x on OSX 10.7.4 #84

Closed tomasikp closed 8 years ago

tomasikp commented 12 years ago

installed db-mysql with node 0.8.8 installed from universal .dmg. No major errors thrown during npm install. When tried to run the program with db-mysql I got an error like cited in #82 :

dlopen(node_modules/db-mysql/build/Release/mysql_bindings.node, 1): no suitable image found.  Did find: node_modules/db-mysql/build/Release/mysql_bindings.node: mach-o, but wrong architecture

installed node from development branch on github, and immediately got an error thrown on npm install:

npm ERR! db-mysql@0.7.6 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
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.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-waf configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls db-mysql
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 11.4.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Library/WebServer/api_v5
npm ERR! node -v v0.9.1-pre
npm ERR! npm -v 1.1.49
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Library/WebServer/api_v5/npm-debug.log
npm ERR! not ok code 0

installed node 0.6.21 and have no problems at all. Appears that db-mysql has build issues on node > 0.6.x

ghost commented 12 years ago

This worked for me on OS X 10.8.

Download MySQL (mysql-5.5.28-osx10.6-x86_64.dmg): http://www.mysql.com/downloads/mysql/ Download Node.js source code: http://nodejs.org/dist/v0.8.12/node-v0.8.12.tar.gz Add the following to ~/.bash_profile: export PATH = $PATH:/usr/local/mysql-5.5.28-osx10.6-x86_64/bin Extract Node.js source code and run: export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/" export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ ./configure make sudo make install Install db-mysql via npm: sudo npm install -g db-mysql