Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT #2107

Closed
meghajayakumar opened this issue Apr 28, 2020 · 2 comments

Comments

@meghajayakumar
Copy link

meghajayakumar commented Apr 28, 2020

  • Node version : v10.16.0
  • OS : Windows 10
  • Package trying to use: node-serialport
Verbose output (from npm or node-gyp):
PS C:\Users\Ergotopia\Documents\Ergotopia\electron-usb-test> .\node_modules\.bin\electron-rebuild.cmd
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.6.8 found at "C:\Python3\python3.exe"
gyp info find VS using VS2017 (15.9.28307.1064) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python3\python3.exe
gyp info spawn args [ 'C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\node-gyp\\gyp\\gyp_main.py',    
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\@serialport\\bindings\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ergotopia\\.electron-gyp\\8.2.4\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Ergotopia\\.electron-gyp\\8.2.4',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\node-gyp',       
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Ergotopia\\\\.electron-gyp\\\\8.2.4\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\@serialport\\bindings',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\@serialport\\bindings\\build',  
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
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:240:19)
gyp ERR! stack     at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack     at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Ergotopia\\Documents\\Ergotopia\\electron-usb-test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=8.2.4" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd C:\Users\Ergotopia\Documents\Ergotopia\electron-usb-test\node_modules\@serialport\bindings
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v6.1.0
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>

Failed with exit code: 7

Have tried most of the solutions found online regarding similar issue, but nothing seems to work.

I have run the command npm install --global --production windows-build-tools to add all dependencies required but I cannot find the MSBuild.exe file in the specified path.

@bnoordhuis
Copy link
Member

Is MSBuild.exe in C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin? If it's not there, then where is it located on your system?

@meghajayakumar
Copy link
Author

I am closing this issue as I could solve it by using the solution given here:
#1747 (comment)

I uninstalled my VS2017 and VS2019 and installed the Visual C++ Build tools from the link as stated in the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants