Cannot spawn Chromium with custom executablePath on Apple M1
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: puppeteer-core 5.5.0 (puppeteer could not install due to #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. (https://github.com/puppeteer/puppeteer/pull/5167)
UPDATE: #6495 may fix it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Error: Failed to launch the browser process! spawn /usr/bin ...
Run the above command inside this path to find missing dependencies - /node_modules/puppeteer/.local-chromium/linux-[970485]/chrome-linux.
Read more >How to fix M1 Mac Puppeteer chromium arm64 bug
Step 1: Install chromium with Homebrew · Step 2: Allow Chromium to open on your M1 Mac · Step 3: Skip future Chromium...
Read more >How To Load Chrome In Puppeteer On Mac - ADocLib
Install Puppeteer on Windows or Mac OS whichever you prefer. ... Cannot spawn Chromium with custom executablePath on Apple M1 #6634.
Read more >Right-click on Mac - Apple Support
Control-click: Press and hold the Control key while you click an item. For example, Control-click an icon, a window, the toolbar, the desktop,...
Read more >puppeteer-core - npm
A high-level API to control headless Chrome over the DevTools Protocol. Latest version: 19.4.1, last published: 9 days ago.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For anyone lazy coming from google, or for anyone without access to an x86 machine I have prepackaged this binary for use with a homebrew chromium install
Steps:
brew install chromiumyarn add https://github.com/seanaye/puppeteer/releases/download/v5.5.0-apple-silicon/puppeteer-core-5.5.0-post.tgzConfirmed it has been fixed in the latest puppeteer-core v7!