chromium: [BUG] spawn Unknown system error -8
Environment
chromium
Version: chromium-min 110.0.1puppeteer
/puppeteer-core
Version: puppeteer-core 19.6.3- Node.js Version: 18.14.1
- Lambda / GCF Runtime: running locally first
Expected Behavior
I tried to run the code here.
Current Behavior
Error: spawn Unknown system error -8
at ChildProcess.spawn (node:internal/child_process:413:11)
at Module.spawn (node:child_process:757:9)
at BrowserRunner.start (file:///app/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserRunner.js:91:34)
at ChromeLauncher.launch (file:///app/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js:68:16)
Steps to Reproduce
See above.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 17 (3 by maintainers)
Commits related to this issue
- Add docs on how to run locally and headfully fixes #63 fixes #69 fixes #38 fixes #55 fixes #42 fixes #28 — committed to Sparticuz/chromium by Sparticuz a year ago
For local development I did this and bow it’s working.
on M1 you can do a
arch -x86_64 zsh
in your terminal prior to running and it should work. You’ll need to have the x86 packages installed prior to. You can do it by running this for example
npm install --arch=x86 --save puppeteer-core@18.0.5
npm install --arch=x86 --save @sparticuz/chromium@106
This happened for me because I was on the new macOS “Apple Silicon” in the terminal Apple will not prompt you to install Rosetta which is required for certain apps to run. Simply running
softwareupdate --install-rosetta
solved the issue for me.More information about Rosetta here https://support.apple.com/en-gb/HT211861
@Kal-Toh I’ve managed to make it work… with playwright. I’ve installed playwright-core as a dependency and playwright as a devDependency and now it knows how to spawn the browser. I’ve tried the same solution with puppeteer but I couldn’t make it work.
Yeah, the issue for me was that it wasn’t compatible with my systems architecture, thus wouldn’t work on a local environment. It functions as expected when deployed.
Best thing to do is code>deploy>test>code>deploy>test etc.