我已将我的节点版本从10升级到12.7,之后我的LDAP模块无效。当我尝试安装最新的LDAP版本时,我收到以下错误
npm install 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搜索时,我遇到了以下帖子
表示v8 C API在Node.js 0.12中发生了显着变化,而0.10。不幸的是,代码的改编需要对C代码库进行史诗重构。
这是否意味着LDAP模块在最新节点中不支持或者我错过了什么....请帮助
答案 0 :(得分:0)
试试这个
sudo apt-get install libldap2-dev