question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not find any Visual Studio installation to use after trying all the tips I could find online

See original GitHub issue
  • Node Version: node -v=v12.18.3 and npm -v=6.14.8
  • Platform: systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" (Windows)
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18362 N/A Build 18362
System Type:               x64-based PC
  • Compiler: msbuild /version & cl (Windows)
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

15.9.21.664Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27043 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
  • Module: zeromq
Verbose output (from npm or node-gyp):
me@me-PC0 D:\Desktop\myapp
# node-gyp configure --msvs_version=2017
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.0
gyp info using node@12.18.3 | win32 | x64
gyp info find Python using Python version 3.8.5 found at "C:\Python\Python38\python.exe"
gyp 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 2017
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017"
gyp ERR! find VS - will only use this version
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - found in "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
gyp ERR! find VS - could not find MSBuild in registry for this version
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS msvs_version does not match this VS Command Prompt or the
gyp ERR! find VS installation cannot be used.
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
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack     at VisualStudioFinder.fail (C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack     at C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack     at C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack     at C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:20
gyp ERR! stack     at C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack     at C:\Users\me\AppData\Roaming\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:310:5)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Apps\\nodejs\\node.exe" "C:\\Users\\me\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--msvs_version=2017"
gyp ERR! cwd D:\Desktop\myapp
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v7.1.0
gyp ERR! not ok

Things I’ve tried to no avail

  • Reinstall VS 2017 with Desktop Development Kit for C++
  • Reinstall node and npm
  • Run the same command in Admin CMD, Admin PowerShell, Admin VC2017 Dev Command Prompt
  • Manually set VCINSTALLDIR environment variable to: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
  • Run npm config set msvs_version 2017 --global, then npm config get msvs_version gives me 2017
  • Restart PC every step of the way

I got the same errors as above every step of the way.

Please help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

13reactions
DeuxAlphacommented, Apr 28, 2021

Deleting the package-lock.json file resolved the problem for me.

As far as I can tell, no node_modules/_package_/bin/* files were being downloaded. I’m not sure why this solved it for me, but there you go.

8reactions
initramcommented, Sep 29, 2020

I also had similar issues recently and what helped me to locate the issue was running the npm command with --loglevel silly added, this gives you a whole lot more info printed out.

My issue was that there were some outdated (non-existing) paths in my LIB environment variable and that made node-gyp fail.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-gyp error Could not find any Visual Studio installation to ...
I found the problem after hours of searching, it was my node version, i was at 16.x.x, I installed node version manager and...
Read more >
Troubleshoot Visual Studio installation and upgrade issues
Online installations · Step 1 - Check whether the problem is a known issue · Step 2 - Try repairing Visual Studio ·...
Read more >
Npm install command failing with message "could not find ...
I was following the project setup. When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops ......
Read more >
nodejs/electron-forge/node-gyp: Could not find any Visual ...
I really had to go into node-gyp source code to locate the issue. The way it locates Visual Studio installation is through a...
Read more >
Managing Extensions in Visual Studio Code
This article explains how to find, install, and manage VS Code extensions from the ... If an extension doesn't provide the functionality you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found