执行npm i 安装vue项目依赖时,下载chromedriver读取超时,错误如下:
> chromedriver@2.46.0 install /node_modules/chromedriver
> node install.js
Current existing ChromeDriver binary is unavailable, proceding with download and extraction.
Downloading from file: https://chromedriver.storage.googleapis.com/2.46/chromedriver_mac64.zip
Saving to file: /var/folders/9n/lq9x___n4ngdlzjfz95zkxzw0000gn/T/2.46/chromedriver/chromedriver_mac64.zip
ChromeDriver installation failed Error with http(s) request: Error: read ECONNRESET
npm WARN ajv-keywords@2.1.1 requires a peer of ajv@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! chromedriver@2.46.0 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the chromedriver@2.46.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! ~/.npm/_logs/2020-07-09T07_25_07_183Z-debug.log
解决方案:指定淘宝chromedriver下载地址
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver