mariano / node-db-mysql

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

Installation error #62

Open ghost opened 12 years ago

ghost commented 12 years ago

Hi, I'm currently trying to install db-mysql on my Mac (v10.7.3) and it's not ok ..

Here a log of the error

npm http GET https://registry.npmjs.org/db-mysql
npm http 304 https://registry.npmjs.org/db-mysql

> db-mysql@0.7.6 install /usr/local/lib/node_modules/db-mysql
> node-waf configure build

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : not found 
Checking for node prefix                 : ok /usr/local 
Checking for program mysql_config        : not found 
/usr/local/lib/node_modules/db-mysql/wscript:34: error: The program ['mysql_config'] is required

> db-mysql@0.7.6 preuninstall /usr/local/lib/node_modules/db-mysql
> rm -rf build/*

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! 
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "db-mysql"
npm ERR! cwd /Users/xxx/Desktop/node-db-mysql
npm ERR! node -v v0.6.13
npm ERR! npm -v 1.1.9
npm ERR! code ELIFECYCLE
npm ERR! message db-mysql@0.7.6 install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/xxx/Desktop/node-db-mysql/npm-debug.log
npm not ok

I've added the following line (export MYSQL_CONFIG=/Applications/MAMP/Library/bin/mysql_config) to my .bash_profile and restart the terminal

echo $MYSQL_CONFIG
/Applications/MAMP/Library/bin/mysql_config
ghost commented 12 years ago

up ?

Sannis commented 12 years ago

Try node-mysql-libmysqlclient if you are looking for Node.js MySQL driver ;)

devvyn commented 12 years ago

Same problem for me. The installer doesn't seem to care about the MYSQL_CONFIG environment variable alone. Perhaps the installation instructions at http://nodejsdb.org/db-mysql/ just need to be clarified. (OS X 10.7) The only way I could install was to set the variable and then navigate to the directory where mysql_config resides and run the installer there without using sudo. The installer completes, but there's nothing in the node_modules directory afterward. I don't fully understand the issue but I can at least confirm it happens to me, too.

Sannis commented 12 years ago

The installer completes, but there's nothing in the node_modules directory afterward. I don't fully understand the issue but I can at least confirm it happens to me, too.

It is ok, compiled addon will be in ./build/default/mysql_bindings.node or in ./build/Release/mysql_bindings.node depending on your node version. You should require db-mysql.js to use it or just install it locally for oyur application via npm.

NachoSoto commented 11 years ago

This is happening to me too... which makes it impossible to install now

aaronfrost commented 11 years ago

I had the same error on Ubunutu 12.04, but installing the libmysqlclient-dev fixed. db-mysql now installs

f9pix commented 11 years ago

haha awesome arronfrost , it working for me now :)