New Coder
New Coder

Reputation: 127

Unable to install leveldown npm package, node-gyp error MSBuild.exe failed with exit code: 1

While trying to install levelDown, installation failing at node-gyp

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Source\Project\node_modules\leveldown
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5

Things i have tried to fix this issue:

but nothing seems to work so far

please help

Upvotes: 1

Views: 2697

Answers (2)

justsomen00b
justsomen00b

Reputation: 1

I had a problem where the install of leveldown as a dependency was making another package ( orbit-db-http-api ) fail. It was an old version of leveldown in the package-lock.json, so that even explicitly installing the latest version npm i [email protected] failed with:

> [email protected] install /home/teide/randomCode/OrbitDB/orbit-db-http-api/node_modules/orbit-db-cache/node_modules/leveldown
> node-gyp-build


> [email protected] install /home/teide/randomCode/OrbitDB/orbit-db-http-api/node_modules/orbit-db-keystore/node_modules/leveldown
> prebuild-install || node-gyp rebuild

Deleting the package-lock.json that came with the repo and reinstalling did the trick (without needing to downgrade Node)

Upvotes: 0

New Coder
New Coder

Reputation: 127

SO after trying many things found out that the issue was with Node version, i was using node version 12.0.0, tried downgrading to version 11.15.0 and it worked.

Upvotes: 2

Related Questions