puppeteer 下载与安装

安装puppeteer报错:

ERROR: Failed to download Chromium r515411! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOA
D" env variable to skip download.
{ Error: read ECONNRESET
    at _errnoException (util.js:1024:11)
    at TLSWrap.onread (net.js:615:25) code: 'ECONNRESET', errno: 'ECONNRESET', s
yscall: 'read' }
npm WARN [email protected] No repository field.


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\John\AppData\Roaming\npm-cache\_logs\2017-11-30T02_14_12_0
26Z-debug.log


解决方法:

1.创建项目crawl

2. npm init

puppeteer 下载与安装_第1张图片


3.cmd 

set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1


4.npm install


5.npm -i puppeteer


puppeteer下载完成



你可能感兴趣的:(nodejs)