48

I am trying to install Puppeteer in Windows 10 using the below command and am getting an error.

The command used to install Puppeteer:

npm install --save PUPPETEER

Error:

ERROR: Failed to set up Chromium r782078! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Error: self signed certificate in certificate chain

I have also tried the below option, but I am still getting the same error.

npm install -g puppeteer --unsafe-perm=true --allow-root
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3563459
  • 567
  • 1
  • 4
  • 14

10 Answers10

64

Note: This is for Ubuntu 18.04 (Bionic Beaver). However, it should be a similar process for Windows though.

Set the environment variable (as the error suggests):

Mac

export PUPPETEER_SKIP_DOWNLOAD='true'

Windows

SET PUPPETEER_SKIP_DOWNLOAD='true'

and then...

npm i puppeteer

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
CIAN STEENKAMP
  • 648
  • 4
  • 4
19

This works for me:

npm install --ignore-scripts puppeteer
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Es You
  • 191
  • 1
  • 2
12

Set an npm mirror:

npm config set puppeteer_download_host=https://npm.taobao.org/mirrors
npm i puppeteer

It will work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
8

Note: It works for MacBook M1 and Node.js 16

export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
omers
  • 162
  • 1
  • 2
  • 9
6

Use:

npm install puppeteer --unsafe-perm

It worked for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Oakley Z
  • 141
  • 2
  • 5
  • 1
    tried npm install puppeteer --unsafe-perm got this error npm ERR! Cannot read properties of null (reading 'pickAlgorithm') – Ashish Karpe Oct 22 '22 at 01:15
2

In my case, I was connected to a VPN which caused me issue in installing Puppeteer.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Himanshu Joshi
  • 100
  • 1
  • 5
2

Try using this:

npm install --ignore-scripts puppeteer
mozway
  • 194,879
  • 13
  • 39
  • 75
1

I had to delete Puppeteer from package.json and redo npm install, in order to make it work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
stoneshishang
  • 433
  • 4
  • 11
1

On Windows (PowerShell)

Do this before installation:

$env:PUPPETEER_SKIP_DOWNLOAD="true"
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
babakfp
  • 164
  • 6
  • For some reason PUPPETEER_SKIP_DOWNLOAD didn't work, but PUPPETEER_SKIP_CHROMIUM_DOWNLOAD did. I added the setting by going to Advanced System Settings and manullay enter the evironment variable in the User variables. Your way is better though (using terminal commands on Windows is always a challenge). – szs Mar 14 '23 at 08:05
0

If you want to run stencil.js and start its developer server, in running the npm install command I had the above error, and by using a recommendation I handled the problem.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131