puppeteer: Failed to download Chromium r536395! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Steps to reproduce
Tell us about your environment:
- Puppeteer version: Not installed
- Platform / OS version: win10x64
- URLs (if applicable):
- Node.js version: 8.10.0
What steps will reproduce the problem?
I ran npm install --save-dev puppeteer
and get a error message as follows:
ERROR: Failed to download Chromium r536395! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: self signed certificate in certificate chain
at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38) code: 'SELF_SIGNED_CERT_IN_CHAIN' }
npm WARN teamtreehouse@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@1.1.1 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer@1.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
What is the expected result? Puppeteer gets installed
What happens instead? It doesn’t get installed and the error message appears
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 52
- Comments: 37 (3 by maintainers)
Commits related to this issue
- fix the permission issue with npm See: https://github.com/GoogleChrome/puppeteer/issues/2173#issuecomment-399745457 — committed to uktrade/directory-periodic-tests by kowalcj0 6 years ago
- [FIX] Allow unsafe_perm for install puppeteer and svgexport ! #7 > https://github.com/puppeteer/puppeteer/issues/2173#issuecomment-399745457 — committed to chusiang/gitbook.ansible.role by chusiang 4 years ago
Solves the issue to me.
Same issue on Ubuntu
Getting the same issue on MacOS
Please try (on windows 10) on powershell
$env:PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=0
then runnpm install -g puppeteer --unsafe-perm=true --allow-root
Your problem should get solved.
For windows 10
export NODE_TLS_REJECT_UNAUTHORIZED=0 && npm install
it works for meThe best way is to export default env var
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn add puppeteer
orPUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm install puppeteer
Same issue on Windows. Would be nice if Puppeteer respected strict-ssl options. Can’t get out from behind our firewall. I’ve tried using a local install of chromium but then ran into issues with runaway processes.
edit: I can get everything to work locally if I use the release which Puppeteer tries to download. Go to https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/YOUR_RELEASE_HERE/chrome-win32.zip, replace your operating system with the correct one found on line 31 of https://github.com/GoogleChrome/puppeteer/blob/master/lib/BrowserFetcher.js and put it in your project root. Use the executablePath option in the API to point Puppeteer to the chrome executable in the files you just downloaded like so:
const browser = await puppeteer.launch({executablePath: './chrome-win32/chrome.exe'});
This gets around my problems with the UNABLE_TO_GET_ISSUER_CERT_LOCALLY flag being set by npm. I really think Puppeteer should respect the strict-ssl flag in .npmrc though.
I’m on Ubuntu bash on windows and try to install
glyphhanger
Best Simplest Solution set the variable as true in local and proceed. PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn it works
@xamgore solution worked for me
same questions, i use
sudo cnpm install -g puppeteer --unsafe-perm=true --allow-root
same Problem as @bardware here:
Same here. Unless I set the NODE_TLS_REJECT_UNAUTHORIZED variable as zero separately before running npm install, it won’t work. Puppeteer’s download system does not seem to honor strict-ssl or NODE_TLS_REJECT_UNAUTHORIZED in the .npmrc file, so my build system is stuck on this because there’s no way for Node to set environment variables in a pre-install step for Puppeteer. Sucks big time.
Possibly “off topic” but worthy of a note: It seems, for me, that using “-unsafe-perm=true --allow-root” works for a number of otherwise “broken” NPM packages. I have likely lost count of the number of packages that show “Error: EACCES: permission denied”. Anyway: Very true for Fedora 30 in this case attempting to install “puppeteer” = “chromium” with NPM 6.5.0
@aslushnikov this is closed but I am still encountering this 5 years later with latest versions of puppeteer (that are transitive dependencies, not even direct dependencies of my project).
It seems wrong to set puppeteer-specific environment vars in my project when I am not even using it (like
PUPPETEER_SKIP_DOWNLOAD
).Seems to me this should be reopened?
And what’s the autorative solution to this issue? - no workarround.
你可能使用了VPN,退出就好了。