请告诉我为什么我无法安装 node-libcurl。以下是安装(npm install node-libcurl)时显示的错误:
> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="305e5f54551d5c59525345425c70011e031e00" rel="noreferrer noopener nofollow">[email protected]</a> install /var/www/node/node_modules/node-libcurl
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/JCMais/node-libcurl/releases/download/v1.3.0/node_libcurl-v1.3.0-node-v57-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="305e5f54551d5c59525345425c70011e031e00" rel="noreferrer noopener nofollow">[email protected]</a> and <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cea0a1aaab8ef6e0f7e0fa" rel="noreferrer noopener nofollow">[email protected]</a> (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 2.6.32-042stab127.2
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/var/www/node/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/var/www/node/node_modules/node-libcurl/lib/binding"
gyp ERR! cwd /var/www/node/node_modules/node-libcurl
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/node/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/node/node_modules/node-libcurl/lib/binding' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/var/www/node/node_modules/node-libcurl/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 2.6.32-042stab127.2
node-pre-gyp ERR! command "/usr/bin/node" "/var/www/node/node_modules/node-libcurl/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/www/node/node_modules/node-libcurl
node-pre-gyp ERR! node -v v8.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/var/www/node/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/var/www/node/node_modules/node-libcurl/lib/binding' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7e10111a1b5312171c1d0b0c123e4f504d504e" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2c424348490140454e4f595e406c1d021f021c" rel="noreferrer noopener nofollow">[email protected]</a> install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-03-04T22_33_32_704Z-debug.log
最佳答案
安装依赖项:
# apt install build-essential libssl-dev libcurl4-gnutls-dev libcurl4-openssl-dev
安装Node.js V9 :
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
使用 5.6.0
npm 版本,安装过程应该不会出现问题:
$ npm init
$ npm install node-libcurl --save
检查:
npm ls | grep node-libcurl
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8fe1e0ebeaa2e3e6edecfafde3cfbea1bca1bf" rel="noreferrer noopener nofollow">[email protected]</a>
关于node.js - 无法在 debian 上安装 node-libcurl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49101266/