npm ERR! puppeteer@8.0.0 install: node install.js
报错解决方案
问题
$ npm i puppeteer
> puppeteer@8.0.0 install C:\Users\11244\node_modules\puppeteer
> node install.js
ERROR: Failed to set up Chromium r856583! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:607:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET',
path: null,
host: 'storage.googleapis.com',
port: 443,
localAddress: undefined
}
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\11244\package.json'
npm WARN 11244 No description
npm WARN 11244 No repository field.
npm WARN 11244 No README data
npm WARN 11244 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! puppeteer@8.0.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the puppeteer@8.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\11244\AppData\Roaming\npm-cache\_logs\2021-04-21T08_26_34_583Z-debug.log
解决方案
- 使用梯子即可
安装成功
$ npm i puppeteer
> puppeteer@8.0.0 install C:\Users\11244\node_modules\puppeteer
> node install.js
Downloading Chromium r856583 - 164.6 Mb [=============] 100% 0.0s
Chromium (856583) downloaded to C:\Users\11244\node_modules\puppeteer\.local-chromium\win64-856583
npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\11244\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\11244\package.json'
npm WARN 11244 No description
npm WARN 11244 No repository field.
npm WARN 11244 No README data
npm WARN 11244 No license field.
+ puppeteer@8.0.0
added 54 packages from 73 contributors and audited 54 packages in 124.074s
8 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities