You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While attempting to install frida-node on Windows, I ran into an unexpected "Visual Studio is not installed" error:
npm error code 1
npm error path C:\Users\jk\AppData\Roaming\npm\node_modules\frida
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm error Downloading toolchain 20241208...
npm error Extracting toolchain...
npm error Downloading SDK 20241208 for windows-x86_64-mt...
npm error Extracting SDK...
npm error prebuild-install warn install No prebuilt binaries found (target=23.5.0 runtime=node arch=x64 libc= platform=win32)
npm error Visual Studio is not installed
npm error A complete log of this run can be found in: C:\Users\jk\AppData\Local\npm-cache\_logs\2025-01-02T21_28_48_409Z-debug-0.log
I found this unusual because while I did not have Visual Studio installed, I had the Visual Studio Build Tools installed. After installing Visual Studio, I got a different "list index out of range" error:
npm error code 1
npm error path C:\Users\jk\AppData\Roaming\npm\node_modules\frida
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm error Downloading toolchain 20241208...
npm error Extracting toolchain...
npm error Downloading SDK 20241208 for windows-x86_64-mt...
npm error Extracting SDK...
npm error prebuild-install warn install No prebuilt binaries found (target=22.10.0 runtime=node arch=x64 libc= platform=win32)
npm error list index out of range
npm error A complete log of this run can be found in: C:\Users\jk\AppData\Local\npm-cache\_logs\2025-01-02T22_52_00_687Z-debug-0.log
Looking at winenv.py it seems like the root cause is in detect_msvc_tool_dir.
In the first case with VS Build Tools only, the vswhere call in detect_msvs_installation_dir returned an empty array because, without specifying -products, vswhere only looks for Visual Studio. This explains the "Visual Studio is not installed" message.
In the second case with Visual Studio installed, detect_msvc_tool_dir assumed that MSVC would be in msvs_dir/VC/Tools/MSVC. In my case, Visual Studio installed to C:\Program Files\Microsoft Visual Studio\2022\Community and had no VC subdirectory. VC was instead located in C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools. The "list index out of range" error comes from what I'm assuming to be an empty array from a failed glob.
After reading the Find VC page in the vswhere docs I tried this change:
This resulted in successfully finding where VC was installed on my PC.
I was thinking of making a pull request, but with semi-recent commits to winenv.py and successful frida-gum CI builds it definitely seems like the existing vswhere call is working, just not for me.
Is there something I'm missing in my setup that would have prevented me from needing this change?
The text was updated successfully, but these errors were encountered:
While attempting to install
frida-node
on Windows, I ran into an unexpected "Visual Studio is not installed" error:I found this unusual because while I did not have Visual Studio installed, I had the Visual Studio Build Tools installed. After installing Visual Studio, I got a different "list index out of range" error:
Looking at winenv.py it seems like the root cause is in
detect_msvc_tool_dir
.In the first case with VS Build Tools only, the
vswhere
call indetect_msvs_installation_dir
returned an empty array because, without specifying-products
,vswhere
only looks for Visual Studio. This explains the "Visual Studio is not installed" message.In the second case with Visual Studio installed,
detect_msvc_tool_dir
assumed that MSVC would be inmsvs_dir
/VC/Tools/MSVC. In my case, Visual Studio installed to C:\Program Files\Microsoft Visual Studio\2022\Community and had no VC subdirectory. VC was instead located in C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools. The "list index out of range" error comes from what I'm assuming to be an empty array from a failed glob.After reading the Find VC page in the
vswhere
docs I tried this change:This resulted in successfully finding where VC was installed on my PC.
I was thinking of making a pull request, but with semi-recent commits to
winenv.py
and successful frida-gum CI builds it definitely seems like the existingvswhere
call is working, just not for me.Is there something I'm missing in my setup that would have prevented me from needing this change?
The text was updated successfully, but these errors were encountered: