Repository navigation
Can't find VS 2022 #2754
Description
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm ERR! code 1
npm ERR! path D:\files\AI\node_modules\gl
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "C:\Users\Ilya\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2022
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
PS D:\files\AI> npm i gpu.js brain.js
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm ERR! code 1
npm ERR! path D:\files\AI\node_modules\gl
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@16.13.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "C:\Users\Ilya\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2022
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:74:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:70:14
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\find-visualstudio.js:372:16
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at D:\files\AI\node_modules\gl\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "D:\programms\nodejs\node.exe" "D:\files\AI\node_modules\gl\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\files\AI\node_modules\gl
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
Above are my logs. If I understood correctly, I can't find the version, how can I fix it?
Activity
cclauss commentedon Oct 28, 2022
https://github.com/nodejs/node-gyp/releases
stanevko-ilya commentedon Oct 29, 2022
And why does npm use 7.1.2 if I have the latest version?
cclauss commentedon Oct 29, 2022
https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md
stanevko-ilya commentedon Oct 29, 2022
It didn't help :(
devaskim commentedon Oct 30, 2022
+1
tspence commentedon Nov 8, 2022
I'm having this same problem, but this is the first clue that there's a solution. I executed these commands:
This got me farther along the installation path. I'm no longer getting "unknown version undefined" for Visual C++ tools.
Thanks very much for this help!
alex-major-digital commentedon Nov 22, 2022
Same issue here, latest packages installed across the board
retrievaaaa commentedon Jan 24, 2023
I get "node_gyp is not a valid npm option" with npm v9.3.1, is there any solution to that?
erickzhao commentedon Feb 21, 2023
@GoldenretriverYT
npm config set node_gypis a deprecated option that gets explicitly blocked as of npm 9 (npm/cli#5719).I would check the node-gyp docs for an updated workaround (although they don't seem to have a proper solution for v9 yet): https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md
verhovsky commentedon Mar 21, 2023
@cclauss can you please re-open this issue? I can't tell how to solve it when using npm 9 and npm 9 is the default version shipped with Node 18, the latest LTS release.
tousifhabib commentedon Apr 30, 2023
@cclauss pls update, I am also facing the same issue
cclauss commentedon Apr 30, 2023
Can someone please create a GitHub Action that fails so that even non-Windows users like me can see this failure?
Please open a new issue that demonstrates this behavior on Node.js 20 or 18 with:
Please read all the text in the issue template before deleting it. Thanks.
gsaslis commentedon May 3, 2023
also facing the same issue with
npm@9.6.5/node@v19.6.0nelsonmlneto commentedon May 9, 2023
Did you manage to solve it? I'm also having this problem. I don't understand why this ticket is closed, it seems there are a lof of people having this issue with newest versions of node and npm on Windows.
Update: I downgraded node and npm versions and it worked. I was working with a sandbox project that requires node 14.18.3 and npm "6.14.15". After doing that, it worked.
cclauss commentedon May 9, 2023
No one can create a GitHub Action that replicates the problem?
GizziXZ commentedon May 21, 2023
This is an issue for me, npm@9.5.1
alihakak commentedon Jul 17, 2023
This worked for me with npm 8.18
noctis0430 commentedon Aug 6, 2023
have this issue with the following setup
node: v18.17.0
npm: v9.6.7
VS Studio: 2022 Community
OS: Windows 10
Still unable to solve the issue after trying all of the mentioned solutions.
I have to resort to installing the Visual C++ build tools for 2017 found here. It work straight away without the need to manually modify anything.
deathemperor commentedon Aug 8, 2023
this instruction works with npm 9.8.0 https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md
specifically running
npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latestdoes itzxhycxq commentedon Oct 10, 2023
try it,if you npm version is 9
npm install -g npm@^8FightToDawn commentedon Jan 5, 2024
I have the same issues
I do not want to update anything, so i have changed
C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\find-visualstudio.js
Add same code to search vs2022. this is not difficult, and it does slove problem
cclauss commentedon Jan 5, 2024
Node-gyp v8 will not find vs2022. Please upgrade to the current version on node-gyp. https://github.com/nodejs/node-gyp/releases
abzohj commentedon Feb 24, 2026
Im using the last version of node-gyp and i have the same problem.
cclauss commentedon Feb 25, 2026
Please open a new issue and provide the command typed and the full error log.