我试图从make
混帐的node-mongodb-native
驱动程序,但是当我尝试并安装它,我不断收到此错误:无法安装节点的MongoDB驱动
: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
(某些行打散为可读性更强)
可疑的部分我是这一行:
Checking for node path : not found
我这是我在我的〜/ .bash_profile中NODE_PATH:
export NODE_PATH=/usr/local/lib/node_modules::/usr/local/lib/node
当我ls
这两个目录的,这是我得到:
$ ls /usr/local/lib/node
wafadmin -> ../../Cellar/node/0.4.8/lib/node/wafadmin
$ ls /usr/local/lib/node_modules
npm
我甚至只是尝试这样做我的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
我不认为可能是在两个位置安装了节点的最佳路径b/c,这可能会导致不同的版本,但这不是重点。
有其他人有问题安装此驱动程序?
是的,好像是一个版本问题。我在github上发布了这个问题,而其他人说他们用v0.5.0-pre安装了它,这是我的,但是一旦我将我的节点版本恢复到v0.4.8,它就安装好了(至少我没有得到任何错误) – hellatan 2011-06-18 12:20:54