Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to download Chromium r515411 #1597

Closed
gp5251 opened this issue Dec 14, 2017 · 25 comments
Closed

Failed to download Chromium r515411 #1597

gp5251 opened this issue Dec 14, 2017 · 25 comments

Comments

@gp5251
Copy link

@gp5251 gp5251 commented Dec 14, 2017

I came across an problem like below when i tried to run npm i puppeteer, is there any solution?

puppeteer@0.13.0 install /Users/guipeng/Desktop/ldl/puppeteer/node_modules/puppeteer
node install.js

ERROR: Failed to download Chromium r515411! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: read ETIMEDOUT
at _errnoException (util.js:1041:11)
at TLSWrap.onread (net.js:606:25) code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'read' }
npm WARN enoent ENOENT: no such file or directory, open '/Users/guipeng/Desktop/ldl/puppeteer/package.json'

@paambaati
Copy link

@paambaati paambaati commented Dec 14, 2017

@gp5251 This might just be an intermittent network issue. Does this happen consistently?

@ThinkRealize
Copy link

@ThinkRealize ThinkRealize commented Dec 15, 2017

@paambaati I also encountered the same situation.

@vc1
Copy link

@vc1 vc1 commented Dec 15, 2017

使用国内Chromium源
https://npm.taobao.org/mirrors

# // > https://npm.taobao.org/mirrors
# // export PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors
# // set PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors

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

或者用淘宝的cnpm 安装,自动使用国内源

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm i puppeteer

还可以手动下载Chromium文件,解压后放在本地
https://npm.taobao.org/mirrors/chromium-browser-snapshots/

  • 放在模块的默认读取目录下
    例如 node_modules\puppeteer\.local-chromium\win64-526987(系统类型-版本号)\chrome-win32(下载的文件名)\
    版本号来自 puppeteer/package.json->puppeteer.chromium_revision,具体见lib/Downloader.js
  • 放在其他目录,运行时设置路径参数
    puppeteer.launch({executablePath:'ChromiumExePath'})

cnpm/cnpmjs.org#1246
storage.googleapis.com 整站代理:https://storage.googleapis.com.cnpmjs.org
https://npm.taobao.org/mirrors
cnpm/binary-mirror-config/package.json

@gp5251
Copy link
Author

@gp5251 gp5251 commented Dec 15, 2017

@vc1 problem resolved, 3q.

@p0psicles
Copy link

@p0psicles p0psicles commented Dec 15, 2017

We're using a private nexus repository. Could I interchange the googleapis.com url, with our own direct route? Are there any other request related attributes we need to take care off?

@aslushnikov
Copy link
Collaborator

@aslushnikov aslushnikov commented Jan 4, 2018

@p0psicles there's PUPPETEER_DOWNLOAD_HOST that you can use to download from a mirror.

@aslushnikov aslushnikov closed this Jan 4, 2018
@p0psicles
Copy link

@p0psicles p0psicles commented Jan 4, 2018

Yes I figured it out eventually. I do think it would help if this would be added to the documentation. Now you need to search through a number of issues or go through the code yourself.

@aslushnikov
Copy link
Collaborator

@aslushnikov aslushnikov commented Jan 4, 2018

@p0psicles I'll be happy to review a PR!

@kiki882727
Copy link

@kiki882727 kiki882727 commented Jan 16, 2018

I tried the above method, But it did not work

cnpm i puppeteer
ERROR: Failed to download Chromium r526987! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
Error: Download failed: server returned code 404. URL: https://cdn.npm.taobao.org/dist/chromium-browser-snapshots/Mac/526987/chrome-mac.zip
    at response (/Users/mac/Desktop/node/learnNode/pupp/node_modules/_puppeteer@1.0.0@puppeteer/lib/Downloader.js:228:21)

cnpm config get registry
http://registry.npm.taobao.org/
npm i puppeteer
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

> puppeteer@1.0.0 install /Users/mac/Desktop/node/learnNode/pupp/node_modules/puppeteer
> node install.js

ERROR: Failed to download Chromium r526987! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
{ Error: read ETIMEDOUT
    at _errnoException (util.js:1024:11)
    at TLSWrap.onread (net.js:615:25) code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'read' }

echo $PUPPETEER_DOWNLOAD_HOST
https://storage.googleapis.com.cnpmjs.org

How can I resolve it?
I tried to manually install It. But hen I run it I got the following error

const puppeteer = require('puppeteer');

(async () => {

    const executablePath = '/Applications/Chromium.app/Contents/MacOS/Chromium';
    const headless = true;
    const context = 'default';

    const browser = await puppeteer.launch({ executablePath, headless });
    const page = await browser.newPage({ context });
    await page.goto('https://example.com');
    await page.screenshot({path: 'example.png'});
    browser.close();

})();

(node:1980) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Protocol error (Page.getFrameTree): 'Page.getFrameTree' wasn't found undefined
(node:1980) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I do not know if this error was caused by a manual installation。
Can anyone help me?

@aslushnikov
Copy link
Collaborator

@aslushnikov aslushnikov commented Jan 16, 2018

I tried the above method, But it did not work
How can I resolve it?

It looks like there's a something that prevents pptr from network access. If there's a proxy, you can set it up with env variables.

I do not know if this error was caused by a manual installation。
Can anyone help me?

@kiki882727 you're trying to run an old chromium. If you're using pptr 1.0.0, try running Chrome Canary instead.

@koutsenko
Copy link

@koutsenko koutsenko commented Feb 4, 2018

Any progress?

@BrickCarvingArtist
Copy link

@BrickCarvingArtist BrickCarvingArtist commented Feb 7, 2018

It doesn't work with any solutions on my mac.
Finally I solve with following steps:

  1. vi .npmrc
  2. type puppeteer_download_host = https://npm.taobao.org/mirrors
  3. yarn add puppeteer@1.0.0 -D
    After waiting for about 10mins, done!
@kiki882727
Copy link

@kiki882727 kiki882727 commented Feb 8, 2018

@aslushnikov thanks for your help, I tried anther version of puppeter -- 0.13.0, It worked very well. I will upgrades it in the feature, But not now, thank you again for your help

@backspaces
Copy link

@backspaces backspaces commented Feb 12, 2018

Same problem. Solved w/ 0.13.0 build.

@backspaces
Copy link

@backspaces backspaces commented Feb 12, 2018

Tried it again with 1.0.0 and it did work. No idea why.

@crsj
Copy link

@crsj crsj commented Feb 21, 2018

Error: Download failed: server returned code 407. URL: https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/526987/chrome-win32.zip

Downloaded the file from https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/526987/chrome-win32.zip

Made sure it is downloadale from below location from a local webserver
http://localhost:8666/chromium-browser-snapshots/Win_x64/526987/chrome-win32.zip

set this in .npmrc
puppeteer_download_host=http://localhost:8666

Did the trick for me; a quick workaround if some one needs

@obihill
Copy link

@obihill obihill commented Jun 13, 2018

sudo npm install puppeteer --unsafe-perm=true --allow-root

I had an issue installing puppeteer on Mac OS (10.10), and also a permissions issue with mkdir for some reason. This solved it.

@zhangtemplar
Copy link

@zhangtemplar zhangtemplar commented Jul 4, 2018

it works @vc1

@Calvin92
Copy link

@Calvin92 Calvin92 commented Oct 12, 2018

@vc1 Niubi, good job.

@racl101
Copy link

@racl101 racl101 commented Nov 6, 2018

@gp5251 This might just be an intermittent network issue. Does this happen consistently?

I think this was the case with me. I tried it a second time and it work.

Running: node v8.11.2 and npm 5.6.0 at the time, if that matters.

@jbricenoz
Copy link

@jbricenoz jbricenoz commented Jan 3, 2019

sudo npm install puppeteer --unsafe-perm=true --allow-root

works fine.

@i-sync
Copy link

@i-sync i-sync commented Mar 21, 2019

sudo npm install puppeteer --unsafe-perm=true --allow-root

I had an issue installing puppeteer on Mac OS (10.10), and also a permissions issue with mkdir for some reason. This solved it.

Thanks, it's work.

@manashmandal
Copy link

@manashmandal manashmandal commented Jan 1, 2020

使用国内Chromium源
https://npm.taobao.org/mirrors

# // > https://npm.taobao.org/mirrors
# // export PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors
# // set PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors

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

或者用淘宝的cnpm 安装,自动使用国内源

npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm i puppeteer

还可以手动下载Chromium文件,解压后放在本地
https://npm.taobao.org/mirrors/chromium-browser-snapshots/

  • 放在模块的默认读取目录下
    例如 node_modules\puppeteer\.local-chromium\win64-526987(系统类型-版本号)\chrome-win32(下载的文件名)\
    版本号来自 puppeteer/package.json->puppeteer.chromium_revision,具体见lib/Downloader.js
  • 放在其他目录,运行时设置路径参数
    puppeteer.launch({executablePath:'ChromiumExePath'})

cnpm/cnpmjs.org#1246
storage.googleapis.com 整站代理:https://storage.googleapis.com.cnpmjs.org
https://npm.taobao.org/mirrors
cnpm/binary-mirror-config/package.json

Thank you! Working!!

fedarko added a commit to gibsramen/qurro that referenced this issue Mar 4, 2020
I *think* the reason downloading mocha-headless-chrome failed
previously was an intermittent network thing? based on
puppeteer/puppeteer#1597 (comment)
at least.

if this still doesn't work there are other workarounds
@JaapWeijland
Copy link

@JaapWeijland JaapWeijland commented May 4, 2020

I had this issue as well when installing puppeteer on Cloud Functions for Firebase. This was the specific error:

Deployment error.
Build failed: {"error": {"canonicalCode": "INVALID_ARGUMENT", "errorMessage": "`npm_install` had stderr output:\nnode-pre-gyp WARN Using request for node-pre-gyp https download \nnode-pre-gyp WARN Using request for node-pre-gyp https download \nERROR: Failed to download Chromium r686378! 
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:64: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@1.20.0 install: `node install.js`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! 
Failed at the puppeteer@1.20.0 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-04T12_34_05_082Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "FFD91768"}}

I was using puppeteer@^1.20.0

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.

@Trinhlvtq
Copy link

@Trinhlvtq Trinhlvtq commented May 7, 2020

@JaapWeijland I'm getting the same error you are when installing puppeteer function Firebase Functions (

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.\n{ Error: read ECONNRESET\n    at TLSWrap.onread (net.js:622:25)\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 errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }\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_17_043Z-debug.log\n\nerror: `npm_install` returned code: 1", "errorType": "InternalError", "errorId": "198B66D6"}}

I was using "puppeteer": "^2.1.1"
I just deploy one more time and it's deploy success. I dont know exact reason of error :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet