From a18a4609adc10d3b5127787af7a67ac0025cd779 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:49:30 +0100 Subject: [PATCH] fix: Allow npm_config_arch override on mac (#32380) If the npm_config_arch environment variable is set on Mac, then use the specified architecture rather than overriding it to x64. Co-authored-by: Tommy MacWilliam --- npm/install.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/npm/install.js b/npm/install.js index f4e858e5cc0df..932bfa6c150c3 100755 --- a/npm/install.js +++ b/npm/install.js @@ -22,7 +22,8 @@ if (isInstalled()) { const platform = process.env.npm_config_platform || process.platform; let arch = process.env.npm_config_arch || process.arch; -if (platform === 'darwin' && process.platform === 'darwin' && arch === 'x64') { +if (platform === 'darwin' && process.platform === 'darwin' && arch === 'x64' && + process.env.npm_config_arch === undefined) { // When downloading for macOS ON macOS and we think we need x64 we should // check if we're running under rosetta and download the arm64 version if appropriate try {