Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find VS 2022 #2754

Closed
stanevko-ilya opened this issue Oct 28, 2022 · 22 comments
Closed

Can't find VS 2022 #2754

stanevko-ilya opened this issue Oct 28, 2022 · 22 comments

Comments

@stanevko-ilya
Copy link

stanevko-ilya commented Oct 28, 2022

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?

@cclauss
Copy link
Contributor

cclauss commented Oct 28, 2022

npm ERR! gyp info using node-gyp@7.1.2

https://github.com/nodejs/node-gyp/releases

@cclauss cclauss closed this as completed Oct 28, 2022
@stanevko-ilya
Copy link
Author

stanevko-ilya commented Oct 29, 2022

npm -g list
├── install@0.13.0
├── node-gyp@9.3.0
├── node-sass@7.0.3
├── npm@8.19.2
└── pkg@5.5.2

And why does npm use 7.1.2 if I have the latest version?

@cclauss
Copy link
Contributor

cclauss commented Oct 29, 2022

https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md

@stanevko-ilya
Copy link
Author

It didn't help :(

@devaskim
Copy link

+1

@tspence
Copy link

tspence commented Nov 8, 2022

I'm having this same problem, but this is the first clue that there's a solution. I executed these commands:

> npm install -g node-gyp
# On Mac:
> npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
# On WIndows:
> npm config set node_gyp c:\users\$USER\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

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
Copy link

Same issue here, latest packages installed across the board

@GoldenretriverYT
Copy link

I'm having this same problem, but this is the first clue that there's a solution. I executed these commands:

> npm install -g node-gyp
# On Mac:
> npm config set node_gyp $(npm prefix -g)/lib/node_modules/node-gyp/bin/node-gyp.js
# On WIndows:
> npm config set node_gyp c:\users\$USER\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

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!

I get "node_gyp is not a valid npm option" with npm v9.3.1, is there any solution to that?

@erickzhao
Copy link

@GoldenretriverYT npm config set node_gyp is 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
Copy link

verhovsky commented 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
Copy link

@cclauss pls update, I am also facing the same issue

@cclauss
Copy link
Contributor

cclauss commented 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:

  1. The command that was run
  2. The full error log

Please read all the text in the issue template before deleting it. Thanks.

@gsaslis
Copy link

gsaslis commented May 3, 2023

also facing the same issue with npm@9.6.5 / node@v19.6.0

@nelsonmlneto
Copy link

nelsonmlneto commented May 9, 2023

also facing the same issue with npm@9.6.5 / node@v19.6.0

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
Copy link
Contributor

cclauss commented May 9, 2023

there are a lof of people having this issue

No one can create a GitHub Action that replicates the problem?

@GizziXZ
Copy link

GizziXZ commented May 21, 2023

This is an issue for me, npm@9.5.1

@alihakak
Copy link

npm config set node_gyp c:\users$USER\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

This worked for me with npm 8.18

@noctis0430
Copy link

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
Copy link

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@latest does it

@zxhycxq
Copy link

zxhycxq commented Oct 10, 2023

try it,if you npm version is 9

npm install -g npm@^8

@FightToDawn
Copy link

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

gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v8.3.0

@cclauss
Copy link
Contributor

cclauss commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests