node.js - 无法在 Node 12.7 中安装 LDAP

标签 node.js ldap npm v8

我已将 Node 版本从 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

当我用谷歌搜索时,我发现了下面的线程

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

这表明与 0.10 相比,Node.js 0.12 中的 v8 C API 发生了巨大变化。不幸的是,代码的改编需要对 C 代码库进行大规模重构。

这是否意味着 LDAP 模块在最新的 Node 中不支持,或者我错过了什么......请帮助

最佳答案

试试这个

sudo apt-get install libldap2-dev

关于node.js - 无法在 Node 12.7 中安装 LDAP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31848637/

相关文章:

npm - 执行 npm install 时出现错误 'tunneling socket'

node.js - 如何在 jetty/tomcat 上部署基于 "create-react-app"的应用程序

node.js - https nginx 403 禁止

javascript - 环回远程方法关系列表到 JSON

node.js - 在 Godaddy 共享 Linux 主机上安装 Nodejs 时出错

java - 具有多个参数的 DirContext 搜索数组

java - LDAP 查询属性大小

javascript - Node Express 中的 URL 参数重写

JavaScript 购买 SDK - Shopify

java - 如何通过 JNDI 更改 LDAP 密码