WordPress.org

Make WordPress Core

Opened 4 months ago

Last modified 4 months ago

#52690 new defect (bug)

`npm install` aborts on Apple Silicon due to Puppeteer not finding appropriate chromium binary

Reported by: afragen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

On Apple Silicon, I get an error running npm install from wordpress-develop due to a puppeteer script.

$ npm install

> puppeteer@4.0.1 install /Users/afragen/Local_Beta_Sites/wordpressdevelop/app/public/node_modules/grunt-contrib-qunit/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/afragen/Local_Beta_Sites/wordpressdevelop/app/public/node_modules/grunt-contrib-qunit/node_modules/puppeteer/lib/BrowserFetcher.js:112
            throw new Error();
            ^

Error
    at /Users/afragen/Local_Beta_Sites/wordpressdevelop/app/public/node_modules/grunt-contrib-qunit/node_modules/puppeteer/lib/BrowserFetcher.js:112:19

I am running the shell session in Rosetta (x86_64) emulation. This has previously worked and not certain if it's related to r50441.

Setting export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true in the session does allow for the npm install to complete.

Change History (4)

#2 @afragen
4 months ago

Thanks Aaron

#3 @afragen
4 months ago

I have used nvm to install node v15.x which is able to be compiled for arm64. Must have Xcode Command Line Tools installed.

  • nvm install 15, give this time to compile/build, currently this installs node v15.10.0
  • nvm use 15
  • nvm alias default 15, this so every new session will use this version of node.

Now there's no need to run the shell session under Rosetta.

Last edited 4 months ago by afragen (previous) (diff)
Note: See TracTickets for help on using tickets.