我已经在Cloud 9实例上安装了MongoDB,但所有安装本机mongodb或mongoose驱动程序的尝试都失败了。
$ npm install mongoose
npm WARN package.json chat-example@0.0.0 No repository field.
npm WARN package.json chat-example@0.0.0 No license field.
\
> kerberos@0.0.17 install /home/ubuntu/workspace/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
make: Entering directory `/home/ubuntu/workspace/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build'
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
../lib/kerberosgss.c:36:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic push
^
../lib/kerberosgss.c:37:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
^
../lib/kerberosgss.c: In function ‘authenticate_gss_client_wrap’:
../lib/kerberosgss.c:362:19: warning: variable ‘server_conf_flags’ set but not used [-Wunused-but-set-variable]
char buf[4096], server_conf_flags;
^
../lib/kerberosgss.c: At top level:
../lib/kerberosgss.c:930:0: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
#pragma clang diagnostic pop
^
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/obj.target/kerberos.node
/usr/bin/ld: cannot find -lkrb5
/usr/bin/ld: cannot find -lgssapi_krb5
collect2: error: ld returned 1 exit status
make: *** [Release/obj.target/kerberos.node] Error 1
make: Leaving directory `/home/ubuntu/workspace/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ubuntu/.nvm/versions/node/v4.1.1/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 Linux 4.2.0-c9
gyp ERR! command "/home/ubuntu/.nvm/versions/node/v4.1.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.1.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/workspace/node_modules/mongoose/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
mongoose@4.2.4 node_modules/mongoose
├── ms@0.7.1
├── async@0.9.0
├── regexp-clone@0.0.1
├── hooks-fixed@1.1.0
├── mpromise@0.5.4
├── mpath@0.1.1
├── muri@1.0.0
├── sliced@0.0.5
├── kareem@1.0.1
├── bson@0.4.19
├── mquery@1.6.3 (debug@2.2.0, bluebird@2.9.26)
└── mongodb@2.0.46 (es6-promise@2.1.1, readable-stream@1.0.31, mongodb-core@1.2.19)
查看输出我注意到它找不到lkrb5
或lgssapi_krb5
我认为它被称为 Kerberos ,但是没有办法解决这个问题。有人在安装方面取得了成功吗?
答案 0 :(得分:1)
安装失败的原因是它需要 Kerberos Dev 工具的最新版本。
sudo apt-get install -y libkrb5-dev
安装后, Mongoose 安装完美无缺。丹尼斯,我没有试过mongo-express
,但认为它也会有用。