Skip to content

Can't find VS 2022 #2754

Closed
Closed

Description

@stanevko-ilya

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

  1. cclauss commented on Oct 28, 2022

    @cclauss
    Contributor

    npm ERR! gyp info using node-gyp@7.1.2

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

  2. stanevko-ilya commented on Oct 29, 2022

    @stanevko-ilya
    Author

    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?

  3. cclauss commented on Oct 29, 2022

    @cclauss
    Contributor
  4. stanevko-ilya commented on Oct 29, 2022

    @stanevko-ilya
    Author

    It didn't help :(

  5. devaskim commented on Oct 30, 2022

    @devaskim

    +1

  6. tspence commented on Nov 8, 2022

    @tspence

    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!

  7. alex-major-digital commented on Nov 22, 2022

    @alex-major-digital

    Same issue here, latest packages installed across the board

  8. retrievaaaa commented on Jan 24, 2023

    @retrievaaaa

    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?

  9. erickzhao commented on Feb 21, 2023

    @erickzhao

    @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

  10. verhovsky commented on Mar 21, 2023

    @verhovsky

    @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.

  11. tousifhabib commented on Apr 30, 2023

    @tousifhabib

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

  12. cclauss commented on Apr 30, 2023

    @cclauss
    Contributor

    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.

  13. gsaslis commented on May 3, 2023

    @gsaslis

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

  14. nelsonmlneto commented on May 9, 2023

    @nelsonmlneto

    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.

  15. cclauss commented on May 9, 2023

    @cclauss
    Contributor

    there are a lof of people having this issue

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

  16. GizziXZ commented on May 21, 2023

    @GizziXZ

    This is an issue for me, npm@9.5.1

  17. alihakak commented on Jul 17, 2023

    @alihakak

    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

  18. noctis0430 commented on Aug 6, 2023

    @noctis0430

    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.

  19. deathemperor commented on Aug 8, 2023

    @deathemperor

    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

  20. zxhycxq commented on Oct 10, 2023

    @zxhycxq

    try it,if you npm version is 9

    npm install -g npm@^8

  21. FightToDawn commented on Jan 5, 2024

    @FightToDawn

    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
    
  22. cclauss commented on Jan 5, 2024

    @cclauss
    Contributor

    Node-gyp v8 will not find vs2022. Please upgrade to the current version on node-gyp. https://github.com/nodejs/node-gyp/releases

  23. abzohj commented on Feb 24, 2026

    @abzohj

    Node-gyp v8 will not find vs2022. Please upgrade to the current version on node-gyp. https://github.com/nodejs/node-gyp/releases

    Im using the last version of node-gyp and i have the same problem.

  24. cclauss commented on Feb 25, 2026

    @cclauss
    Contributor

    Please open a new issue and provide the command typed and the full error log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions