Puppeteer下载失败处理

dark
LiinNs
  1. Set “PUPPETEER_SKIP_CHROMIUM_DOWNLOAD” env variable to skip download.
1
2
3
4
5
vim .npmrc
# add this line
puppeteer_skip_chromium_download=true
Or
npm config set puppeteer_skip_chromium_download true -g
  1. Use mirro to download
1
2
3
vim .npmrc
# add this line
type puppeteer_download_host = https://npm.taobao.org/mirrors
  1. Just skip download puppeteer env PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true npm i puppeteer -D Or npm install puppeteer --ignore-scripts Then view the needed reversion from /node_modules/puppeteer/package.json
1
2
3
"puppeteer": {
  "chromium_revision": "637110"
}

Download it from https://npm.taobao.org/mirrors/chromium-browser-snapshots/

And at last unzip it under /node_modules/puppeteer.local-chromium/mac-637110/chrome-mac/ as below