I’m trying to build the Blue Ocean plugin, but npm install fails due to node-gyp being unable to detect MSBuild, even though I have Visual Studio Build Tools 2022 installed.
My system information:
OS: Windows 11
Node version: 18.20.7 LTS
npm version: 9.6.6
node-gyp version: 11.1.0
Python version: 3.10.11
Visual Studio Build Tools 2022 is installed
MSVC v143 is installed
Windows SDK is installed
error log:
npm error code 1
npm error path C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-sass
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/build.js
npm error Building: C:\Program Files\nodejs\node.exe C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm error gyp info it worked if it ends with ok
npm error gyp verb cli [
npm error gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm error gyp verb cli 'C:\\Users\\Vaccarino Giovanni\\Documents\\opensrc\\blueocean-plugin\\jenkins-design-language\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm error gyp verb cli 'rebuild',
npm error gyp verb cli '--verbose',
npm error gyp verb cli '--libsass_ext=',
npm error gyp verb cli '--libsass_cflags=',
npm error gyp verb cli '--libsass_ldflags=',
npm error gyp verb cli '--libsass_library='
npm error gyp verb cli ]
npm error gyp info using node-gyp@7.1.2
npm error gyp info using node@18.20.7 | win32 | x64
npm error gyp verb command rebuild []
npm error gyp verb command clean []
npm error gyp verb clean removing "build" directory
npm error gyp verb command configure []
npm error gyp verb find Python checking Python explicitly set from command line or npm configuration
npm error gyp verb find Python - "--python=" or "npm config get python" is "C:\Users\Vaccarino Giovanni\AppData\Local\Microsoft\WindowsApps\python.exe"
npm error gyp verb find Python - executing "C:\Users\Vaccarino Giovanni\AppData\Local\Microsoft\WindowsApps\python.exe" to get executable path
npm error gyp verb find Python - executable path is "C:\Users\Vaccarino Giovanni\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm error gyp verb find Python - executing "C:\Users\Vaccarino Giovanni\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe" to get version
npm error gyp verb find Python - version is "3.10.11"
npm error gyp info find Python using Python version 3.10.11 found at "C:\Users\Vaccarino Giovanni\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm error gyp verb get node dir no --target version specified, falling back to host node version: 18.20.7
npm error gyp verb command install [ '18.20.7' ]
npm error gyp verb install input version string "18.20.7"
npm error gyp verb install installing version: 18.20.7
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" 9
npm error gyp verb install version is good
npm error gyp verb get node dir target node version installed: 18.20.7
npm error gyp verb build dir attempting to create "build" dir: C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-sass\build
npm error gyp verb build dir "build" dir needed to be created? C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-sass\build
npm error gyp verb find VS msvs_version not set from command line or npm config
npm error gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp verb find VS unknown version "undefined" found at "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
npm error gyp verb find VS could not find a version of Visual Studio 2017 or newer to use
npm error gyp verb find VS looking for Visual Studio 2015
npm error gyp verb find VS - not found
npm error gyp verb 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 msvs_version not set from command line or npm config
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS unknown version "undefined" found at "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
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 looking for Visual Studio 2015
npm error gyp ERR! find VS - not found
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 **************************************************************
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:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm error gyp ERR! stack at C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm error gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm error gyp ERR! stack at C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm error gyp ERR! stack at C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm error gyp ERR! stack at C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\util.js:54:7
npm error gyp ERR! stack at C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-gyp\lib\util.js:33:16
npm error gyp ERR! stack at ChildProcess.exithandler (node:child_process:430:5)
npm error gyp ERR! stack at ChildProcess.emit (node:events:517:28)
npm error gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
npm error gyp ERR! System Windows_NT 10.0.26100
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Vaccarino Giovanni\\Documents\\opensrc\\blueocean-plugin\\jenkins-design-language\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm error gyp ERR! cwd C:\Users\Vaccarino Giovanni\Documents\opensrc\blueocean-plugin\jenkins-design-language\node_modules\node-sass
npm error gyp ERR! node -v v18.20.7
npm error gyp ERR! node-gyp -v v7.1.2
npm error gyp ERR! not ok
npm error Build failed with error code: 1