We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8720ac6 commit 0f647e4Copy full SHA for 0f647e4
1 file changed
src/node_os.cc
@@ -91,6 +91,21 @@ static void GetOSInformation(const FunctionCallbackInfo<Value>& args) {
91
return;
92
}
93
94
+#ifdef _WIN32
95
+ // On Windows, uv_os_uname may return "unknown" for the machine field on ARM64.
96
+ // Try to detect the processor architecture via Windows APIs.
97
+ if (strcmp(info.machine, "unknown") == 0) {
98
+ SYSTEM_INFO sys_info;
99
+ GetSystemInfo(&sys_info);
100
+
101
+ // Map Windows processor architecture to machine designations
102
+ // PROCESSOR_ARCHITECTURE_ARM64 = 12
103
+ if (sys_info.wProcessorArchitecture == 12) {
104
+ snprintf(info.machine, sizeof(info.machine), "arm64");
105
+ }
106
107
+#endif
108
109
// [sysname, version, release, machine]
110
Local<Value> osInformation[4];
111
if (String::NewFromUtf8(env->isolate(), info.sysname)
0 commit comments