Snippet. A quick fix to "The chromium binary is not available for arm64" error when running yarn install/npm install

Just throwing out a quick note on this as it's a tiny issue which I wasted a considerable amount of time on this afternoon.

Basically, if you have an Apple Silicon Mac (M1 or newer) you may run into the error "The chromium binary is not available for arm64" when installing node modules - I personally ran into it while trying to install Puppeteer, but there may be other instances of this out there.

There are plenty of Google results for this search already, but I found the top results to be a little convoluted and required making more fundamental changes to my system than I was willing to do, considering I've been using M1 for 6 months now and don't regularly run into this kind of issue.

So the solution, which I eventually stumbled across here is to append your usual install command with arch -x86_64, which forces the command to run through Rosetta. So, the full command (depending on your package manager) would become:

arch -x86_64 yarn install


arch -x86_64 npm install

Good luck!

3rd September 2021

Side projects