请教Ubuntu14.04 下npm install mongodb 报错怎么处理
发布于 4天前 作者 twang281314 202 次浏览 来自 问答

下面是错误信息 root@iZ94ibykvawZ:~# npm install mongodb /

[email protected] install /root/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos (node-gyp rebuild) || (exit 0)

make: Entering directory /root/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos/build' CXX(target) Release/obj.target/kerberos/lib/kerberos.o In file included from ../lib/kerberos.cc:1:0: ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory #include <gssapi/gssapi.h> ^ compilation terminated. make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1 make: Leaving directory/root/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 (/usr/src/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 3.13.0-32-generic gyp ERR! command “node” “/usr/src/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” gyp ERR! cwd /root/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos gyp ERR! node -v v0.12.6 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok [email protected] node_modules/mongodb ├── [email protected] ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected]) 麻烦知道的大神指点一下

4 回复

去查一下文档,应该是c库少头文件

安装 kerberos 依赖

sudo apt-get install libkrb5-dev

可以去mongodb官网下载tgz包,解压后配下环境变量即可。据说通过apt安装的mongodb版本比较低。

来自炫酷的 CNodeMD

@wyvernnot 嗯,的确是少了这个, 谢了 哈

回到顶部