ERROR: Failed to download Chromium r686378! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download

The best way is to export default env var PUPPETEER_SKIP_CHROMIUM_DOWNLOAD

PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn add puppeteer or
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer

I fixed it by installing Chromium manually using this command:

node node_modules/puppeteer/install.js

I had same issue with [email protected] install when trying to run npm i aws-azure-login on mac, after doing sudo npm install -g puppeteer --unsafe-perm=true --allow-root. It seems Puppeteer doesn't install globally with execution permissions for all users so you'll need to modify them (https://libraries.io/npm/aws-azure-login). You can try sudo chmod -R go+rx $(npm root -g)

I finally got aws-azure-login to install without any issues by changing npm default behavior to install global packages in my home directory:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
source ~/.profile
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.profile
source ~/.profile

See https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally