I have been stuck with this error since the past 2 days. Any help will be appreciated. I am trying to rebuild the app to use serialport npm package. Node version: 14.16.1.
I want to work with the package serialport alongside electron with react. But when I run the command .\node_modules.bin\electron-rebuild.cmd, I get the following error:
⠹ Building module: bindings, Completed: 0Attempting to build a module with a space in the path
See https://github.com/nodejs/node-gyp/issues/65#issuecomment-368820565 for reasons why this may not work
⠴ Building module: bindings, Completed: 0gyp info find Python using Python version 3.9.4 found at "C:\Users\Family\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
⠙ Building module: bindings, Completed: 0gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.9.31205.134) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1500) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS - "2019"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\@serialport\bindings'.
Error: Could not find any Visual Studio installation to use
Error: node-gyp failed to rebuild 'C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\@serialport\bindings'.
Error: Could not find any Visual Studio installation to use
at ModuleRebuilder.rebuildNodeGypModule (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Rebuilder.rebuildModuleAt (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\rebuild.js:190:9)
at async Rebuilder.rebuild (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\rebuild.js:152:17)
at async C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\cli.js:146:9
Btw I have had installed the microsoft build tools both manually and using npm command : npm install --global windows-build-tools. Here's what I installed manually via .exe:
Been using this https://github.com/bradtraversy/simple-electron-react boilerplate.
node-gyp
globally with admin privileges.[email protected]
Windows 10
,Electron :13.0.0
,node : v14.16.1
,yarn : 1.22.10
, electron-react-boilerplate