2

I have problem to activate Puppeteer in my MacOS environment (M1 processor). I get the following error message:

    /usr/local/lib/node_modules/pa11y-ci/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:194
            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 (/usr/local/lib/node_modules/pa11y-ci/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:194:20)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/pa11y-ci/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:186:85)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)

My local setting is:

  • Node.js -v v22.15.0
  • NPM -v 9.5.1
  • macos 15.5
  • DDEV 1.24.6
  • Docker version 28.1.1, build 4eba377

Can anyone tell me how I can clear the error message and then use Puppeteer? Many thanks for your help

I have reinstalled Chromium from the homebrew package manager and tried to make the path to Chromium known in the OS. I also tried to install Puppeteer within DDE and run it correctly.

I expected Puppeteer to be executable in the project or via `ddev ssh`.

6
  • 1
    It's needing Chromium inside the browser (not via homebrew, which puts it on the host), and Chromium isn't packaged for linux/arm64. You may be able to sort this out using the techniques in ddev.com/blog/amd64-with-rosetta-on-macos Commented Jun 17 at 12:45
  • 1
    You may want to look at how the folks do it in the add-on github.com/ddev/ddev-selenium-standalone-chrome, which uses a native arm64 docker image. Commented Jun 17 at 12:46
  • 1
    Many thanks for your tip, i'll try this. Commented Jun 17 at 12:59
  • 1
    great stuff thanks Commented Jun 17 at 13:59
  • 1
    The intro on ddev-selenium-standalone-chrome says "This service can be used with any project type" Commented Jun 17 at 16:20

1 Answer 1

2

I recently had to explore this, and there are good techniques for Apple Silicon shown in Fixing "The chromium binary is not available for arm64"

  • Make sure you have installed chromium somehow, and export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true.

  • If you don't have Chromium installed, use sudo apt install chromium-browser or brew install chromium or whatever is appropriate for your system. On Apple Silicon, brew install chromium --no-quarantine. These are better than letting puppeteer download its own version of Chromium.

  • Since you have manually installed chromium, export PUPPETEER_EXECUTABLE_PATH="$(which chromium)" to set the path to the chromium executable.

These techniques have been added to the ddev-puppeteer README.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.