Skip to content

Commit

Permalink
fix: Allow npm_config_arch override on mac (electron#32266)
Browse files Browse the repository at this point in the history
If the npm_config_arch environment variable is set on Mac, then use the
specified architecture rather than overriding it to x64.
  • Loading branch information
tmacwill authored and t57ser committed Jan 25, 2022
1 parent 50ee3bb commit 517b0f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion npm/install.js
Expand Up @@ -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 {
Expand Down

0 comments on commit 517b0f4

Please sign in to comment.