Last updated: Apr 5, 2024
Reading time·3 min
The error "ERROR: Failed to set up Chromium r800071! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download." occurs when your environment fails to set up the Chromium browser when installing Puppeteer.
To solve the error, set the PUPPETEER_SKIP_DOWNLOAD
environment variable to
true
and rerun the installation command.
Here is the complete error message.
ERROR: Failed to set up Chromium r800071! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download. Error: self-signed certificate in certificate chain
Open your terminal in your project's root directory (where your package.json
)
file is and set the PUPPETEER_SKIP_DOWNLOAD
environment variable to true
.
If you are on macOS or Linux, run the following command in bash
or zsh
.
# For macOS and Linux export PUPPETEER_SKIP_DOWNLOAD=true export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer
If you are on Windows and use CMD (Command Prompt), run the following command.
# For Windows (Command Prompt) SET PUPPETEER_SKIP_DOWNLOAD=true SET PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer
If you are on Windows and use PowerShell, use the following command instead.
# For Windows (Power Shell) $env:PUPPETEER_SKIP_DOWNLOAD="true" $env:PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true" npm install puppeteer
After you set the environment variable, try to rerun the installation command.
npm install puppeteer
puppeteer
using --unsafe-perm
If the issue persists, try to install the puppeteer
module using the
--unsafe-perm
flag.
npm install puppeteer --unsafe-perm=true
The --unsafe-perm
flag forces npm to download the package's binary.
If the error persists, try to add the --allow-root
flag.
npm install puppeteer --unsafe-perm=true --allow-root
If that didn't work either, try setting the --ignore-scripts
flag.
When the flag is set, the package's pre-install and post-install scripts won't run.
npm install puppeteer --ignore-scripts
You can also set the flag when using yarn
.
yarn add --ignore-scripts puppeteer
If the error persists, it is most likely caused by your Node.js version.
There are 2 main ways to install the LTS version of Node.js:
nvm
module to manage your Node.js version.If you already have nvm
installed issue to following 2 commands to switch to
the LTS version.
nvm install --lts nvm use --lts
If you don't have nvm
installed, click on the link that relates to your
operating system:
After you install the long-term supported version and switch to it, try to
install the puppeteer
package.
npm install puppeteer
You can use the node -v
command to verify that you are running the LTS version
of Node.
node -v
If none of the suggestions helped, you can try to set the
PUPPETEER_DOWNLOAD_HOST
environment variable before installing the module.
npm config set PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors npm install puppeteer
If that doesn't resolve the issue, remove the configuration property.
npm config rm PUPPETEER_DOWNLOAD_HOST
You can learn more about the related topics by checking out the following tutorials: