hellatan
hellatan

Reputation: 3577

Unable to install node-mongodb-driver

I'm trying to make the node-mongodb-native driver from git, but when i try and install it i keep on getting this error:

:node-mongodb-native $ make  
make -C ./external-libs/bson  
rm -rf build .lock-wscript bson.node  
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 /Users/name/local/node  
'configure' finished successfully (0.087s)  
Waf: Entering directory `/Users/name/Sites/git/node-mongodb-native/external-libs/bson/build'  
[1/9] cxx: bson.cc -> build/default/bson_1.o  
[2/9] cxx: long.cc -> build/default/long_1.o  
[3/9] cxx: objectid.cc -> build/default/objectid_1.o  
[4/9] cxx: binary.cc -> build/default/binary_1.o  
[5/9] cxx: code.cc -> build/default/code_1.o  
[6/9] cxx: dbref.cc -> build/default/dbref_1.o  
[7/9] cxx: timestamp.cc -> build/default/timestamp_1.o  
[8/9] cxx: local.cc -> build/default/local_1.o  
[9/9] cxx_link: build/default/bson_1.o build/default/long_1.o build/default/objectid_1.o 
build/default/binary_1.o build/default/code_1.o 
build/default/dbref_1.o build/default/timestamp_1.o 
build/default/local_1.o -> build/default/bson.node  
Waf: Leaving directory `/Users/name/Sites/git/node-mongodb-native/external-libs/bson/build'  
'build' finished successfully (1.935s)  

node.js:183  
        throw e; // process.nextTick error, or 'error' event on first tick  
        ^  
Error: dlopen(/Users/name/Sites/git/node-mongodb-native/external-libs/bson/build/default/bson.node, 1): Symbol not found: _ev_rt_now  
  Referenced from: /Users/name/Sites/git/node-mongodb-native/external-libs/bson/build/default/bson.node  
  Expected in: flat namespace  
 in /Users/name/Sites/git/node-mongodb-native/external-libs/bson/build/default/bson.node  
    at Object..node (module.js:472:11)  
    at Module.load (module.js:339:31)  
    at Function._load (module.js:298:12)  
    at require (module.js:367:19)  
    at Object.<anonymous> (/Users/name/Sites/git/node-mongodb-native/external-libs/bson/test_bson.js:5:10)  
    at Module._compile (module.js:427:26)  
    at Object..js (module.js:466:10)  
    at Module.load (module.js:339:31)  
    at Function._load (module.js:298:12)  
    at Array.<anonymous> (module.js:479:10)  
make[1]: *** [all] Error 1  
make: *** [build_native] Error 2 

(some lines broken up for easier readability)

The suspicious part to me is this line:

Checking for node path : not found 

I have this as my NODE_PATH in my ~/.bash_profile:

export NODE_PATH=/usr/local/lib/node_modules::/usr/local/lib/node

when I ls both of those directories, this is what i get:

$ ls /usr/local/lib/node
wafadmin -> ../../Cellar/node/0.4.8/lib/node/wafadmin
$ ls /usr/local/lib/node_modules
npm

I even just tried this as my NODE_PATH:

export NODE_PATH=/usr/local/lib/node_modules:/usr/local/lib/node:$HOME/local/node/lib/node_modules:$HOME/local/node/lib/node

which I don't think might be the best path b/c it has node installed in two locations which could lead to varying versions, but that's beside the point.

has anyone else had issues installing this driver?

Upvotes: 0

Views: 933

Answers (2)

Kaje
Kaje

Reputation: 851

NPM is the best choice to manage node related packages. If you already have npm, you just run npm install -g mongodb. It will install the node mongo driver into your global node_modules directory. If you download and install node from its official website, npm will come by default.

Upvotes: 1

powers
powers

Reputation: 686

Which version of node are you running? I was using v0.5.0-pre and I had this exact same error. Once I downgraded to v0.4.8 it worked.

brew install node

Or download v0.4.8 here

Upvotes: 0

Related Questions