Fix for The chromium binary is not available for arm64 on Mac Puppetter

This tutorial explains about How to fix error The chromium binary is not available for arm64 on Mac Terminals.

On Mac, The error throws during running yarn or npm or pnpm to install application dependencies if projects uses puppeter as a dependencies in package.json

Means, installation steps failed without installation of puppeter on Mac Environment.

Here is an error complete stack trace

npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! The chromium binary is not available for arm64
npm ERR!If you are on Ubuntu, you can install with:

 apt-get install chromium-browser
 npm ERR!myapplication/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112
            throw new Error();

Solution to install chromium manually and configure the path of the chromium location

Let’s see how to install chromium on Mac environment and fix this error.

Mac

Chromium error in MAC M1 pueppter and ventura

Following below steps to fix chrome puppeter error

  • Install chrome manually using homebrew

Go to terminal, type below command

brew install chromium --no-quarantine

--no-quarantine allows you to not get Chromium is damanged and not opened.

brew command only works if homebrew installed to Mac M1 environment.

Next, Check if chromium installed correctly or not using below command

which chromium   // 👉 /opt/homebrew/bin/chromium
  • Privacy Settings to change thirdparty apps allow to open

By default, Third party apps are not opened and restrictied by default privacy Settings.

Change this to allow with below steps

  • Open Launchpad

  • Search System Preferences and open it

  • Security & Privacy > General

  • Enable Open Anway

  • Add CHROMIUM Environment variable to skip ChROMIUM install in future

add below configuration in ~.zshrc or .bash file

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`

Next Restart terminal to take these changes.

Fix for Docker The chromium binary is not available for arm64 on MAC M1