项目使用vue开发,通过npm install安装全局依赖的时候,出错了,卡在了chromedriver的地方,日志内容
-
huyikangdeMacBook-Pro:vbap-widgets kangkang$ npm install
-
-
> [email protected] install /Users/kangkang/vbap-widgets/node_modules/chromedriver
-
> node install.js
-
-
Downloading https://chromedriver.storage.googleapis.com/2.33/chromedriver_mac64.zip
-
Saving to /var/folders/6_/vt2sqf214dn36kyl97183j6c0000gn/T/chromedriver/chromedriver_mac64.zip
-
ChromeDriver installation failed Error with http(s) request: Error: read ETIMEDOUT
-
npm WARN [email protected] No license 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 logging output above.
-
-
npm ERR! A complete log of this run can be found in:
-
npm ERR! /Users/kangkang/.npm/_logs/2017-11-28T01_10_25_967Z-debug.log
解决办法:
npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver
运行安装成功
-
huyikangdeMacBook-Pro:vbap-widgets kangkang$ npm install chromedriver --chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver
-
-
> [email protected] install /Users/kangkang/vbap-widgets/node_modules/chromedriver
-
> node install.js
-
-
Downloading http://npm.taobao.org/mirrors/chromedriver/2.33/chromedriver_mac64.zip
-
Saving to /var/folders/6_/vt2sqf214dn36kyl97183j6c0000gn/T/chromedriver/chromedriver_mac64.zip
-
Received 783K...
-
Received 1564K...
-
Received 2348K...
-
Received 3131K...
-
Received 3914K...
-
Received 4695K...
-
Received 5299K total.
-
Extracting zip contents
-
Copying to target path /Users/kangkang/vbap-widgets/node_modules/chromedriver/lib/chromedriver
-
Fixing file permissions
-
Done. ChromeDriver binary available at /Users/kangkang/vbap-widgets/node_modules/chromedriver/lib/chromedriver/chromedriver
-
npm WARN [email protected] No license field.
-
-
-
added 2 packages in 13.709s