无法在节点12.7中安装LDAP

我已经将我的节点版本从10升级到12.7,之后我的LDAP模块不工作。当我试图安装最新的LDAP版本时,我得到了下面的错误

npm安装LDAP

> node-gyp rebuild gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/0.12.7" gyp WARN EACCES attempting to reinstall using temporary dev dir "/home/ubuntu/node_modules/LDAP/.node-gyp" make: Entering directory `/home/ubuntu/node_modules/LDAP/build' CXX(target) Release/obj.target/LDAP/src/LDAP.o ../src/LDAP.cc:10:18: fatal error: ldap.h: No such file or directory compilation terminated. make: *** [Release/obj.target/LDAP/src/LDAP.o] Error 1 make: Leaving directory `/home/ubuntu/node_modules/LDAP/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/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.2.0-40-virtual gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild" gyp ERR! cwd /home/ubuntu/node_modules/LDAP gyp ERR! node -v v0.12.7 gyp ERR! node-gyp -v v2.0.2 gyp ERR! not ok npm ERR! Linux 3.2.0-40-virtual npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "LDAP" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! code ELIFECYCLE npm ERR! LDAP@1.2.1 install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the LDAP@1.2.1 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the LDAP package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls LDAP npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/ubuntu/npm-debug.log 

当我GOOGLE了我碰到下面的线程

https://github.com/jeremycx/node-LDAP/issues/70

其中说,v8 C API在Node.js 0.12中发生了巨大的变化,而0.10则是如此。 不幸的是,代码的适应需要对C代码库进行史诗般的重构。

这是否意味着LDAP模块不支持在最新的节点,或者我错过了一些东西….好心的帮助

尝试这个

 sudo apt-get install libldap2-dev