If you see this on Windows:
node-gyp error Could not find any Visual Studio installation to use
do not start by reinstalling everything.
node-gyp usually appears after a package falls back to local native compilation. The useful question is not "how do I reinstall Node?" It is:
Which layer is broken: npm, the project folder, Electron, a native module, or Visual Studio Build Tools?
Here is the order I use.
1. Confirm Node and npm first
Run this in a fresh PowerShell window:
node -v
npm -v
where node
where npm
If npm is not recognized, fix that before touching Build Tools. A broken PATH can make every later error misleading.
2. Confirm you are in the project root
Get-Location
Test-Path .\package.json
Test-Path .\node_modules
If package.json is missing, you are in the wrong folder.
If node_modules is missing, run:
npm install
Then read the first real error. Do not jump straight to Visual Studio.
3. Identify the package that is compiling
Run:
npm install
npm rebuild
npm ls node-gyp
npm ls better-sqlite3
Look in the log for:
node-gypprebuild-installMSBuildcl.exeWindows SDKVCBuild
If the package is better-sqlite3, windows-key-listener, or another native module, the fix depends on the Node/Electron version combination. It may need a compatible prebuilt binary or an Electron-compatible rebuild, not just Visual Studio.
4. Check whether Visual Studio C++ tools are detected
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
If this prints a path, C++ tools are visible.
If it prints nothing, Visual Studio Build Tools may be missing the C++ workload.
Check npm's Visual Studio setting:
npm config get msvs_version
npm config get python
A stale msvs_version can point npm/node-gyp at an older toolchain.
5. Install or repair Build Tools only if the log requires it
In Visual Studio Installer, the usual workload is:
- Desktop development with C++
- MSVC C++ x64/x86 build tools
- Windows 10 or Windows 11 SDK
After installing or repairing it, open a new PowerShell window and rerun:
node -v
npm -v
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
npm rebuild
npm run dev
If it still fails, stop reinstalling Visual Studio and go back to the exact package that is compiling.
Free diagnostic
I made a read-only Windows diagnostic for this kind of setup failure:
Run the free Windows AI coding setup diagnostic
It checks the layers in order:
- Runtime: Node.js, npm, PATH
- Project: folder,
package.json,node_modules - Electron: install hook and binary
- Native modules:
better-sqlite3, key listeners,node-gyp - Build Tools: Visual Studio C++ toolchain
- Voice coding stack: Windows audio, WSL, Codex, Claude Code, OpenWhispr
The script is read-only. It does not install, delete, or modify files.
GitHub repo:
https://github.com/wiaikit/wiaikit-windows-ai-coding-setup-repair
Paid recovery path
The paid WiaiKit repair kit is the longer layer-by-layer recovery path after the diagnostic tells you what is broken: npm PATH, Electron, node-gyp, Visual Studio Build Tools, native modules, OpenWhispr, Codex, Claude Code, and push-to-talk voice workflows.
For this specific node-gyp error, start with the free diagnostic above.













