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 · 20 comments

Comments

Projects
None yet
@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

This comment has been minimized.

paambaati commented Dec 14, 2017

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

@ThinkRealize

This comment has been minimized.

ThinkRealize commented Dec 15, 2017

@paambaati I also encountered the same situation.

@vc1

This comment has been minimized.

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

This comment has been minimized.

gp5251 commented Dec 15, 2017

@vc1 problem resolved, 3q.

@p0psicles

This comment has been minimized.

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

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

This comment has been minimized.

Contributor

aslushnikov commented Jan 4, 2018

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

@kiki882727

This comment has been minimized.

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

koutsenko commented Feb 4, 2018

Any progress?

@BrickCarvingArtist

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

backspaces commented Feb 12, 2018

Same problem. Solved w/ 0.13.0 build.

@backspaces

This comment has been minimized.

backspaces commented Feb 12, 2018

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

@crsj

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

zhangtemplar commented Jul 4, 2018

it works @vc1

@Calvin92

This comment has been minimized.

Calvin92 commented Oct 12, 2018

@vc1 Niubi, good job.

@racl101

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment