puppeteer: Failed to download Chromium r722234
Steps to reproduce
Tell us about your environment:
- Puppeteer version: v2.1.1
- Platform / OS version: Google Cloud Functions (HTTP)
- URLs (if applicable):
- Node.js version: Nodejs 8
What steps will reproduce the problem? I have use puppeteer in my function. When I deploy function on Cloud Functions for Firebase, i got this error. I just retried it a couple of times and eventually it would install correctly. Not really a fix but it may indicate it was just trying to install it on a malfunctioning serverless instance or something.
What is the expected result? No error
What happens instead?
Deployment error.
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nERROR: Failed to download Chromium r722234! Set \"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD\" env variable to skip download.\nError: end of central directory record signature not found\n at /workspace/node_modules/yauzl/index.js:167:14\n at /workspace/node_modules/yauzl/index.js:473:5\n at /workspace/node_modules/fd-slicer/index.js:32:7\n at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)\n -- ASYNC --\n at BrowserFetcher.<anonymous> (/workspace/node_modules/puppeteer/lib/helper.js:111:15)\n at Object.<anonymous> (/workspace/node_modules/puppeteer/install.js:66:16)\n at Module._compile (module.js:653:30)\n at Object.Module._extensions..js (module.js:664:10)\n at Module.load (module.js:566:32)\n at tryModuleLoad (module.js:506:12)\n at Function.Module._load (module.js:498:3)\n at Function.Module.runMain (module.js:694:10)\n at startup (bootstrap_node.js:204:16)\n at bootstrap_node.js:625:3\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! puppeteer@2.1.1 install: `node install.js`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the puppeteer@2.1.1 install script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2020-05-07T08_22_18_757Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "3F4C9440"}}
Sometime it’s a other error
Deployment error.
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nERROR: Failed to download Chromium r722234! Set \"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD\" env variable to skip download.\nError: end of central directory record signature not found\n at /workspace/node_modules/yauzl/index.js:167:14\n at /workspace/node_modules/yauzl/index.js:473:5\n at /workspace/node_modules/fd-slicer/index.js:32:7\n at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)\n -- ASYNC --\n at BrowserFetcher.<anonymous> (/workspace/node_modules/puppeteer/lib/helper.js:111:15)\n at Object.<anonymous> (/workspace/node_modules/puppeteer/install.js:66:16)\n at Module._compile (module.js:653:30)\n at Object.Module._extensions..js (module.js:664:10)\n at Module.load (module.js:566:32)\n at tryModuleLoad (module.js:506:12)\n at Function.Module._load (module.js:498:3)\n at Function.Module.runMain (module.js:694:10)\n at startup (bootstrap_node.js:204:16)\n at bootstrap_node.js:625:3\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! puppeteer@2.1.1 install: `node install.js`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the puppeteer@2.1.1 install script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /builder/home/.npm/_logs/2020-05-07T08_22_18_263Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "8FDB325B"}}
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15
use --unsafe-perm.It works for me!
npm i puppeteer -g --unsafe-perm
we are having the same issue and its a random thing which makes it pretty frustrating. we have dockerfile which failed during npm install on puppeteer with the exact same error. rerun the build usually just works.
why installing chromiun is so unstable?
The issue is resolved for me. It was a case of Prerequisites not met. The nodejs library on my system was 10.8.0. Once I upgraded the node version, the install went through ( I even wrote some samples using the library)
Okay guys, so i had the same problem that @yescay, @dipto0321 and @Norrismi have and just found a workarround… There are many posts saying that you can try to install with the variable set to true with the command:
PUPPETEER_SKIP_DOWNLOAD=true npm install puppeteer
But after the installation, the package would not work properly. One way to resolve the problem, is to use firefox instead of chromium: Install it with the command: PUPPETEER_PRODUCT=firefox npm install puppeteer
And explicitly use the firefox browser when you want to use puppeteer: puppeteer.launch(product: ‘firefox’);
@lechen26 after further review, I found out it was something with the node version. After changing the version a couple a times and it worked just fine. You cant try both the 10.2 and the 14.3. Recommendation: use NVM to manage your versions!
Worked for me. Thanks.
I have been facing issue on Node 14 on Ubuntu 18.04 so try it if on similar enviornment.