错误原因:
使用国内镜像时 puppeteer安装失败
解决方法:
npm i --ignore-scripts
忽略各种报错命令
npm i --legacy-peer-deps --ignore-scripts --registry=https://registry.npm.taobao.org
错误如下
npm ERR! code 1
npm ERR! path /Users/ex_wljr_zhaozikai/mypro/pay-cashier-mobile/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! ERROR: Failed to download Chromium r686378! Set "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" env variable to skip download.
npm ERR! Error: getaddrinfo ENOTFOUND storage.googleapis.com
npm ERR! at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
npm ERR! -- ASYNC --
npm ERR! at BrowserFetcher.<anonymous> (/Users/ex_wljr_zhaozikai/mypro/pay-cashier-mobile/node_modules/puppeteer/lib/helper.js:111:15)
npm ERR! at Object.<anonymous> (/Users/ex_wljr_zhaozikai/mypro/pay-cashier-mobile/node_modules/puppeteer/install.js:64:16)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:17:47 {
npm ERR! errno: -3008,
npm ERR! code: 'ENOTFOUND',
npm ERR! syscall: 'getaddrinfo',
npm ERR! hostname: 'storage.googleapis.com'
npm ERR! }