首页 > 解决方案 > nodejs couchbase安装失败

问题描述

我已经安装了多个软件包,例如 Express、Joi、Fastify,没有任何问题。但是当我尝试使用 npm 安装 couchbase 包时,它总是失败。请在日志下方找到。

> couchbase@2.6.10 install C:\Users\JInbaraj\Documents\VSCode_Projects\Node-js\Express\node_modules\couchbase
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=12.14.1 runtime=node arch=x64 libc= platform=win32)

C:\Users\JInbaraj\Documents\VSCode_Projects\Node-js\Express\node_modules\couchbase>if not defined npm_config_node_gyp (node "D:\node-v12.14.1-win-x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "D:\node-v12.14.1-win-x64\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:456:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:81:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "D:\\node-v12.14.1-win-x64\\node.exe" "D:\\node-v12.14.1-win-x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\JInbaraj\Documents\VSCode_Projects\Node-js\Express\node_modules\couchbase
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
npm WARN Express@1.0.0 No description
npm WARN Express@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! couchbase@2.6.10 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the couchbase@2.6.10 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!     C:\Users\JInbaraj\AppData\Roaming\npm-cache\_logs\2020-01-14T10_42_00_899Z-debug.log

我正在使用稳定的 Node JS 版本。我试图重新安装 Node JS。在引用此链接后,我尝试重新安装 Python 2.7、windows build-essentials 并尝试了 Visual Studio 2015 工具,但都是徒劳的。

有什么建议吗?

标签: node.jsnpminstallationcouchbasenode-gyp

解决方案


终于问题解决了!

使用npm命令安装时,显示Visual Studio 构建工具已成功安装(我什至尝试使用npm多次安装)。后来,我使用Visual Studio 安装程序并选择了Visual Studio 构建工具 2017来验证安装。为了验证安装,我尝试了修复选项,令我惊讶的是,它只是部分下载并从那里恢复。等待一段时间完成下载和安装。然后重新启动PC并尝试npm i couchbase......它成功了!


推荐阅读