2015-10-13 68 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的