[wp-trac] [WordPress Trac] #52356: npm install does not work on wordpress-trunk on new Mac M1's
WordPress Trac
noreply at wordpress.org
Fri Dec 3 08:16:50 UTC 2021
#52356: npm install does not work on wordpress-trunk on new Mac M1's
-------------------------------+------------------------------
Reporter: justinahinon | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version: 5.7
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Comment (by talldanwp):
I've also encountered this after getting a new laptop, but a curious thing
is that there's no such problem in the Gutenberg project.
For some background, Gutenberg only uses the `puppeteer-core` package.
That package doesn't install Chromium when running `npm install`, instead
chromium is installed when running the test command:
https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/scripts
/test-e2e.js#L31-L33
This is distinct from the `puppeteer` package, which installs chromium
whenever running `npm install` (which can be a frustrating waste of time).
My first thought was that perhaps core should also use `puppeteer-core`,
but then I was surprised to find it already does. It uses the same tooling
as Gutenberg.
Looking into the dependencies a bit further, it looks like the issue is
that the `grunt-contrib-qunit` package has puppeteer as a dependency, and
an old version at that. This is what's causing the issue. Versions of
puppeteer are locked to specific chromium versions, so it's likely that
the version of chromium that project depends on doesn't support the M1.
IMO, any fix should be made upstream to `grunt-contrib-qunit`, or perhaps
WordPress should look into an alternative to that project that doesn't
cause chromium to be installed when running npm install.
As a workaround you can set the `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true`
environment variable, which allows `npm install` to finish, but running
tests won't work. Technically you should be able to install chromium
independently (`brew install chromium`) and also set
`PUPPETEER_EXECUTABLE_PATH`, but I haven't been able to get that working.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52356#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list