Search code examples
node.jsnpminstallationcouchbasenode-gyp

nodejs couchbase install failure


I have installed multiple packages like Express, Joi, Fastify without any issue. But when I try to install couchbase package using npm, it's always failing. Please find below the log.

> 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

I am using a stable Node JS release. I have tried to reinstall the Node JS. I have tried to reinstall Python 2.7, windows build-essentials and also tried visual studio 2015 tools after referring this link, but all in vain.

Any advice?


Solution

  • Finally the issue is fixed!

    Visual studio build tools were shown installed successfully when installed using npm command (I have even tried installing multiple times using npm). Later, I used Visual studio installer and selected Visual studio build tools 2017 to verify the install. To verify the install, I have tried the Repair option and to my surprise, it was just downloaded partially and it resumed from there. Waited for sometime to complete the download and install. Then restarted the PC and tried npm i couchbase... It worked!