2015-10-13 65 views
0

我想为NodeJs安装Mongo驱动程序,并且我在npm安装上遇到了一些错误。我使用的节点版本是4.2.0,我在依赖关系中的mongo版本是2.0。我不确定是否可以,或者是因为我错过了一些依赖关系。nodejs的MongoDb驱动程序安装错误

在那里我试图安装的是者平台:

的Linux pcname 3.2.0-4-RT-AMD64#1 SMP PREEMPT RT Debian的3.2.65-1 + deb7u2 x86_64的GNU/Linux的

而NodeJS是从源码编译的。

npm install mongodb 
npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
\ 
> [email protected] install /path_to_project/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos 
> (node-gyp rebuild) || (exit 0) 

make: se ingresa al directorio `/path_to_project/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: File or directory doesn't exist 
#include <gssapi/gssapi.h> 
         ^
compilation terminated. 
make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1 
make: se sale del directorio `/path_to_project/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/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 Linux 3.2.0-4-rt-amd64 
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 /path_to_project/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos 
gyp ERR! node -v v4.2.0 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! not ok 
+1

的[NPM安装猫鼬会导致GYP和Kerberos错误可能的复制(GSSAPI/gssapi.h找不到文件) ](http://stackoverflow.com/questions/32919589/npm-install-mongoose-causes-gyp-and-kerberos-errors-gssapi-gssapi-h-file-not-fo) –

+0

哦,是的,谢谢你。对不起,打开一个新的问题。 – Sinjuice

+0

伟大的蓝色按钮,你应该紧迫,而不是基本上说,其他问题是一样的事情与你的。 –

回答

2

尝试:

命令和apt-get安装libkrb5-dev的