0

I have installed VS2022 (v17.12.3) with the build tools v14.42.34433. I am using the latest node-gyp v11 to install and compile a few native dependencies.

For me this stands out:

find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio2022円\Community\VC\Tools\MSVC14円.42.34433"

How is this possible, the version 14.42.34433 is right there. Any idea what might be causing this?

npm error gyp sill find Python execFile result: err = null
npm error gyp sill find Python execFile result: stdout = "3.12.6\r\n"
npm error gyp sill find Python execFile result: stderr = ""
npm error gyp verb find Python - version is "3.12.6"
npm error gyp info find Python using Python version 3.12.6 found at "C:\Python312\python.exe"
npm error gyp verb get node dir no --target version specified, falling back to host node version: 22.12.0
npm error gyp verb install input version string "22.12.0"
npm error gyp verb install installing version: 22.12.0
npm error gyp verb install --ensure was passed, so won't reinstall if already installed
npm error gyp verb install version is already installed, need to check "installVersion"
npm error gyp verb got "installVersion" 11
npm error gyp verb needs "installVersion" 11
npm error gyp verb install version is good
npm error gyp verb on Windows; need to check node.lib
npm error gyp verb get node dir target node version installed: 22.12.0
npm error gyp verb build dir attempting to create "build" dir: C:\Users\daniel\AppData\Local\npm-cache\_cacache\tmp\git-clonemdv8FQ\build
npm error gyp verb build dir "build" dir needed to be created? Yes
npm error gyp verb find VS msvs_version was set from command line or npm config
npm error gyp verb find VS - looking for Visual Studio version 2019
npm error gyp verb find VS running in VS Command Prompt, installation path is:
npm error gyp verb find VS "C:\Program Files\Microsoft Visual Studio2022円\Community\VC\Tools\MSVC14円.42.34433"
npm error gyp verb find VS - will only use this version
npm error gyp sill find VS processing installation: "C:\Program Files\Microsoft Visual Studio2022円\Community\VC\Tools\MSVC14円.42.34433"
npm error gyp sill find VS - failed to parse version: undefined
npm error gyp sill find VS - found VC.MSBuild.Base
npm error gyp sill find VS - found VC.Tools.x86.x64
npm error gyp sill find VS - invalid versionYear: undefined
npm error gyp sill find VS vsInfo: [
npm error gyp sill find VS {
npm error gyp sill find VS path: 'C:\\Program Files\\Microsoft Visual Studio\2022円\\Community\\VC\\Tools\\MSVC\14円.42.34433',
npm error gyp sill find VS msBuild: null,
npm error gyp sill find VS toolset: null,
npm error gyp sill find VS sdk: null
npm error gyp sill find VS }
npm error gyp sill find VS ]
npm error gyp verb find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio2022円\Community\VC\Tools\MSVC14円.42.34433"
npm error gyp verb find VS could not find a version of Visual Studio 2017 or newer to use
asked Jan 4, 2025 at 4:49
4
  • do you have python installed correctly and set correct PATH? Commented Jan 9, 2025 at 2:58
  • Yes, it's properly set up Commented Jan 9, 2025 at 3:42
  • Are the env variables for Visual Studio set correctly? I guess yes, but if not try this: set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio2017円\Community\Common7\Tools\ set VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio2019円\Community\Common7\Tools\ set VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio2022円\Community\Common7\Tools\ Commented Jan 9, 2025 at 20:45
  • It looks like node-gyp attempts to get the VS version from an environment variable here. There's a comment there that implies that if you run in the VS developer command prompt, it will setup the right environment variables for you. Commented Jan 14, 2025 at 2:46

1 Answer 1

0

It looks like node-gyp cannot correctly determine the Visual Studio version installed, even though it's installed. Run this command in cmd as administrator:

set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ set VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio2017円\Community\Common7\Tools\ set VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio2019円\Community\Common7\Tools\ set VS170COMNTOOLS=C:\Program Files\Microsoft Visual Studio2022円\Community\Common7\Tools\ 
answered Jan 13, 2025 at 15:58
Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.