16

I've been trying to work on a code I wrote a couple of months back ran into the following error,

> puppeteer@5.5.0 install /Users/xyz/Documents/xyz.github.io/node_modules/puppeteer
> node install.js

The chromium binary is not available for arm64: 
If you are on Ubuntu, you can install with: 

 apt-get install chromium-browser

/Users/xyz/Documents/xyz.github.io/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112
            throw new Error();

Error
    at /Users/xyz/Documents/xyz.github.io/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112:19
    at FSReqCallback.oncomplete (node:fs:194:21)

Chromium arm64 is installed for some reason puppeteer doesn't seem to recognize it. Any workaround for the above?

Solutions I've tried :

https://github.com/puppeteer/puppeteer/issues/6622

Frant
  • 5,382
  • 1
  • 16
  • 22
BPDESILVA
  • 2,040
  • 5
  • 15
  • 35

2 Answers2

35

Fixed via 50b810d. Clean install node modules

Type the following in the terminal sudo nano ~/.zshrc , copy the code below & paste proceed to save.

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`
  1. Remove existing node modules, package-lock.json & cache from the project.

    rm -rf node_modules/
    rm -rf package-lock.json
    rm -rf .cache

  2. Install node modules.

    npm i

Patch works.

----- Updated ------------- (27/04/2021)

Make sure you've to install chromium. If you haven't follow @Rocco's advice brew install --cask chromium.

----- Updated ------------- (18/11/2021)

Hajonsoft updated the thread on github - https://www.courier.com/blog/tips-and-tricks-to-setup-your-apple-m1-for-development while this maybe a good fix for most developers & dependencies/tools please note that rosetta emulation is not available in certain regions verified it myself in southeast asia.

------------ Updated ------------------ (04/06/2022)

In case in which chromium is not installed properly please follow @Tomer Omri advice and run brew install chromium --no-quarantine.

BPDESILVA
  • 2,040
  • 5
  • 15
  • 35
  • 8
    Make sure you install chromium before all that via `brew install --cask chromium` and also to open a new terminal after changes in `~/.zshrc`. – Rocco Apr 27 '21 at 10:50
  • 1
    Thanks for the suggestion @Rocco I will update the answer. – BPDESILVA Apr 27 '21 at 15:33
5

Adding to the answer above, I needed to run:

brew install chromium --no-quarantine

On my M1 so the chromium will be installed correctly

Tomer Omri
  • 921
  • 9
  • 6
  • 1
    Thanks Tomer Omri for the input haven't updated this thread for a while. All please follow this additional step to ensure a seamless installation. – BPDESILVA Apr 03 '22 at 09:32