自制mongodb安装osx后,mongodb驱动程序安装失败

时间:2015-09-23 03:51:32

标签: node.js mongodb

我使用'brew install mongodb'在OSX Yosemite上使用homebrow安装mongodb然后我使用'npm install mongodb'安装mongodb驱动程序。这就是我得到的:

-
> kerberos@0.0.14 install /Users/adminname/WebstormProjects/Server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)

  CXX(target) Release/obj.target/kerberos/lib/kerberos.o
  CXX(target) Release/obj.target/kerberos/lib/worker.o
  CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
  CC(target) Release/obj.target/kerberos/lib/base64.o
  CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
  SOLINK_MODULE(target) Release/kerberos.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/kerberos.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/adminname/WebstormProjects/Server/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
mongodb@2.0.43 node_modules/mongodb
├── es6-promise@2.1.1
├── readable-stream@1.0.31 (string_decoder@0.10.31, isarray@0.0.1, core-util-is@1.0.1, inherits@2.0.1)
└── mongodb-core@1.2.12 (bson@0.4.12, kerberos@0.0.14)
Westons-MBP-2:Server adminname$ 

2 个答案:

答案 0 :(得分:1)

这解决了我的问题。

cd / usr / local / lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

然后, sudo npm install mongo

https://github.com/nodejs/node/issues/2933

答案 1 :(得分:0)

尝试使用sudo用户安装mongodb

  

sudo npm install mongodb