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
HelloWorld
2,0244 gold badges40 silver badges92 bronze badges
1 Answer 1
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\
Sign up to request clarification or add additional context in comments.
1 Comment
Community
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.
lang-js
PATH?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\