Cannot spawn Chromium with custom executablePath on Apple M1 #6634
Closed
Description
Steps to reproduce
Tell us about your environment:
- Puppeteer version: puppeteer-core 5.5.0 (puppeteer could not install due to Installation fails on Apple Silicon / M1 #6622)
- Platform / OS version: macOS Big Sur 11.0.1 (on Macbook Air, M1, 2020)
- URLs (if applicable): No
- Node.js version: v15.2.1 (arm64 build)
What steps will reproduce the problem?
Please include code that reproduces the issue.
- Install
puppeteer-core
- Make
test.js
:
const puppeteer = require('puppeteer-core')
;(async () => {
const browser = await puppeteer.launch({
executablePath:
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
})
const page = await browser.newPage()
await page.goto('https://example.com')
await page.screenshot({ path: 'example.png' })
await browser.close()
})()
- Run
node ./test.js
What is the expected result?
Take a screenshot of https://example.com/ into example.png
, with using custom executable path.
What happens instead?
Puppeteer tries to spawn not existed chromium path /usr/bin/chromium-browser
.
/Users/yhatt/Programs/tmp/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:193
reject(new Error([
^
Error: Failed to launch the browser process! spawn /usr/bin/chromium-browser ENOENT
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/Users/yhatt/Programs/tmp/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at ChildProcess.<anonymous> (/Users/yhatt/Programs/tmp/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:185:85)
at ChildProcess.emit (node:events:329:20)
at Process.ChildProcess._handle.onexit (node:internal/child_process:275:12)
at onErrorNT (node:internal/child_process:467:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
I think Puppeteer is always overriding executable path when running on arm64. (#5167)
puppeteer/src/node/Launcher.ts
Lines 107 to 108 in 46e74ff
UPDATE: #6495 may fix it.
Metadata
Assignees
Labels
No labels