Home > Back-end >  npm config set msvs_version does not work? (node-gyp)
npm config set msvs_version does not work? (node-gyp)

Time:09-27

npm config set msvs_version does not work and I still get msvs_version not set from command line or npm config.

I have all the necessary paths set and I have Visual Studio 2017, 2019 and 2022 installed with the necessary C thingys.

Full error:

gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.10.7 found at "C:\Python310\python.exe"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS - will only use this version
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp ERR! find VS checking VS2019 (16.11.32901.82) 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 - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2019 (16.11.32901.82) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
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.18362.0
gyp ERR! find VS - does not match this Visual Studio Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.2094) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - found "Visual Studio C   core features"
gyp ERR! find VS - found VC   toolset: v141
gyp ERR! find VS - missing any Windows SDK
gyp ERR! find VS checking VS2017 (15.9.28307.2094) 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 - does not match this Visual Studio Command Prompt
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 looking for Visual Studio 2013
gyp ERR! find VS - not found
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

CodePudding user response:

Fixed


  • I found the dependency that was causing this error
  • uninstalled it using npm uninstall <dependency-name>
  • I redownloaded it as a devDependency with the npm install <dependency-name> -save-dev.

This fixed my issue for now but I do not know if this is a long term solution, I'll probably update this answer when I get to the phase of packaging the app.

  • Related