diff --git a/lib/Launcher.js b/lib/Launcher.js index 54f8225c695..89326018d1a 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -298,7 +298,7 @@ class Launcher { const browserFetcher = new BrowserFetcher(this._projectRoot); // puppeteer-core doesn't take into account PUPPETEER_* env variables. if (!this._isPuppeteerCore) { - const executablePath = process.env['PUPPETEER_EXECUTABLE_PATH']; + const executablePath = process.env.PUPPETEER_EXECUTABLE_PATH || process.env.npm_config_puppeteer_executable_path || process.env.npm_package_config_puppeteer_executable_path; if (executablePath) { const missingText = !fs.existsSync(executablePath) ? 'Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: ' + executablePath : null; return { executablePath, missingText };