gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 22:34:15 24 4
gpt4 key购买 nike

我已将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com