0

I have been trying to install a package from GitHub for quite some time now and have resolved many node-gyp errors while trying. However, there is still one error that I haven't been able to resolve and that is:

could not use PowerShell to find Visual Studio 2017 or newer

I have installed all the requirements and have PowerShell, Visual Studio C++ 2022, Visual Studio Build Tools 2022, and Visual Studio Community 2022.

The issue is that yarn can not use PowerShell for unknown reasons; therefore, it can not find Visual Studio C++.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
  • 1
    The Visual Studio executables normally aren't in `$env:PATH`, perhaps that's the problem. Perhaps running your command from a Visual Studio Developer Command Prompt fixes the problem (locate it via the Start Menu). – mklement0 Jul 16 '22 at 15:48
  • @mklement0 I run the yarn command in the Visual Studio Developer Command Prompt and got the same exact errors as above! – najmieh sadat safarabadi Jul 17 '22 at 05:07
  • @mklement0 should I config the ``$env:PATH?`` I am not sure why it can not use the PowerShell! – najmieh sadat safarabadi Jul 17 '22 at 05:08
  • 1
    You can try, but isn't that what the Visual Studio Developer Command Prompt does? I was only guessing that `$env:PATH` is the problem; perhaps the package uses a different mechanism (registry?) to look for Visual Studio. – mklement0 Jul 17 '22 at 12:58

0 Answers0