Skip to content

Cant build: unable to find Visual Studio 2026 #3250

@hluica

Description

@hluica

I installed some tool depends on zeromq, which needs to be built with node-gyp, using parameter --msvs_version=2026. Here are the errors:

npm warn Unknown cli config "--msvs_version". This will stop working in the next major version of npm.
...
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build || npm run build:libzmq
npm error > zeromq@5.3.1 build:libzmq
npm error > node-gyp rebuild
npm error (node:17472) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated.
npm error (Use `node --trace-deprecation ...` to show where the warning was created)
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@11.4.2
npm error gyp info using node@24.11.1 | win32 | x64
npm error gyp info find Python using Python version 3.14.0 found at "C:\Users\hanluica\AppData\Local\Python\pythoncore-3.14-64\python.exe"
npm error gyp ERR! find VS
npm error gyp ERR! find VS msvs_version was set from command line or npm config
npm error gyp ERR! find VS - looking for Visual Studio version 2026
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\18\Community"
npm error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2017 as it is only supported up to Node.js 21
npm error gyp ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
npm error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm error gyp ERR! find VS
npm error gyp ERR! find VS valid versions for msvs_version:
npm error gyp ERR! find VS
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS You need to install the latest version of Visual Studio
npm error gyp ERR! find VS including the "Desktop development with C++" workload.
npm error gyp ERR! find VS For more information consult the documentation at:
npm error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm error gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:118:11)
npm error gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:17)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
npm error gyp ERR! stack at async createBuildDir (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:112:18)
npm error gyp ERR! stack at async run (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18)
npm error gyp ERR! System Windows_NT 10.0.26220
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm error gyp ERR! cwd C:\Users\hanluica\AppData\Roaming\npm\node_modules\ijavascript\node_modules\zeromq
npm error gyp ERR! node -v v24.11.1
npm error gyp ERR! node-gyp -v v11.4.2
npm error gyp ERR! not ok
...

Evenif running the command in a VS Command Prompt, it can still not use the VS 2026.
The command with --msvs_version=2022 and causes no error (VS 2022 installed).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions