Search code examples
javascriptnode-gyp

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


  • Node Version: node: v12.13.0 npm: 6.12.0
  • Platform: windows 10

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:

  • Installed python latest version
  • Installed visual studio 2017 community version with c++ dev tools
  • set VCTargetsPath and MSBuild enviroments variables
  • set VCTargetsPath in windows registry
  • Tried running npm install --global --production windows-build-tools

but nothing seems to work so far

please help


Solution

  • 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.