diff --git a/deps/npm/node_modules/node-gyp/lib/find-visualstudio.js b/deps/npm/node_modules/node-gyp/lib/find-visualstudio.js index d3815112e65de0..25550ec9b41009 100644 --- a/deps/npm/node_modules/node-gyp/lib/find-visualstudio.js +++ b/deps/npm/node_modules/node-gyp/lib/find-visualstudio.js @@ -126,7 +126,11 @@ VisualStudioFinder.prototype = { // Invoke the PowerShell script to get information about Visual Studio 2017 // or newer installations findVisualStudio2017OrNewer: function findVisualStudio2017OrNewer (cb) { - var ps = path.join(process.env.SystemRoot, 'System32', + // SysWOW64 PowerShell is needed on ARM64 because of the COM classes and + // interfaces used by Find-VisualStudio.cs, which are not registered for + // being used from ARM64 processes. + var systemDirectory = process.arch === 'arm64' ? 'SysWOW64' : 'System32' + var ps = path.join(process.env.SystemRoot, systemDirectory, 'WindowsPowerShell', 'v1.0', 'powershell.exe') var csFile = path.join(__dirname, 'Find-VisualStudio.cs') var psArgs = [