From 7c1be20aef46aaf5029732a580ec65aa8008aa9c Mon Sep 17 00:00:00 2001 From: Dhiraj Gagrai Date: Thu, 22 Sep 2022 13:16:11 +0530 Subject: [PATCH] fix: add missing npm config environment variable (#8996) PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM can now also be specified from npm config by using it's lowercase variant --- src/node/BrowserFetcher.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/BrowserFetcher.ts b/src/node/BrowserFetcher.ts index 7eeae6ee7d1..17c7601b1b8 100644 --- a/src/node/BrowserFetcher.ts +++ b/src/node/BrowserFetcher.ts @@ -38,7 +38,9 @@ import {assert} from '../util/assert.js'; import tar from 'tar-fs'; import bzip from 'unbzip2-stream'; -const {PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM} = process.env; +const experimentalChromiumMacArm = + process.env['PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM'] || + process.env['npm_config_puppeteer_experimental_chromium_mac_arm']; const debugFetcher = debug('puppeteer:fetcher'); @@ -224,7 +226,7 @@ export class BrowserFetcher { switch (this.#product) { case 'chrome': this.#platform = - os.arch() === 'arm64' && PUPPETEER_EXPERIMENTAL_CHROMIUM_MAC_ARM + os.arch() === 'arm64' && experimentalChromiumMacArm ? 'mac_arm' : 'mac'; break;