Search code examples
node.jsnpmshopware6

bin/build-storefront.sh on Apple Silicon


While trying to run the command "bin/build-storefront.sh" on my Apple Silicon, I encountered an error message. The error message indicates that there is a problem with the "puppeteer" module and that the chromium binary is not available for arm64 architecture. The error suggests installing chromium with a specific command, but it seems not to work for Apple Silicon. Are there any known workarounds or solutions available to run this command successfully on Apple Silicon?

The error message is as follows:

npm ERR! code 1
npm ERR! path /var/www/html/vendor/shopware/storefront/Resources/app/storefront/node_modules/puppeteer
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: 
npm ERR! 
npm ERR!  sudo apt install chromium
npm ERR! 
npm ERR! 
npm ERR!  sudo apt install chromium-browser
npm ERR! 
npm ERR! /var/www/html/vendor/shopware/storefront/Resources/app/storefront/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115
npm ERR!                     throw new Error();
npm ERR!                     ^
npm ERR! 
npm ERR! Error
npm ERR!     at /var/www/html/vendor/shopware/storefront/Resources/app/storefront/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:115:27
npm ERR!     at FSReqCallback.oncomplete (node:fs:202:21)

npm ERR! A complete log of this run can be found in:

Solution

  • This is only a requirement if you want to run e2e tests with Cypress. Just skip the download by running the script like that:

    PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 bin/build-storefront.sh