ERROR command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --di

vue-cli 3.0构建vue 项目时,报错如下:
 

> [email protected] install C:\vueDemo\myproject\node_modules\chromedriver
> node install.js

Downloading https://chromedriver.storage.googleapis.com/2.41/chromedriver_win32.zip
Saving to C:\Users\13902\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
ChromeDriver installation failed Error with http(s) request: Error: connect ETIMEDOUT 216.58.220.208:443
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!     C:\tool\node_cache\_logs\2018-08-20T02_24_35_243Z-debug.log
 ERROR  command failed: npm install --loglevel error --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist

解决办法:npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

效果如下:

C:\vueDemo>npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

> [email protected] install C:\vueDemo\node_modules\chromedriver
> node install.js

Downloading http://cdn.npm.taobao.org/dist/chromedriver/2.41/chromedriver_win32.zip
Saving to C:\Users\13902\AppData\Local\Temp\chromedriver\chromedriver_win32.zip
Received 806K...
Received 1607K...
Received 2394K...
Received 3185K...
Received 3468K total.
Extracting zip contents
Copying to target path C:\vueDemo\node_modules\chromedriver\lib\chromedriver
Done. ChromeDriver binary available at C:\vueDemo\node_modules\chromedriver\lib\chromedriver\chromedriver.exe
npm WARN saveError ENOENT: no such file or directory, open 'C:\vueDemo\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:\vueDemo\package.json'
npm WARN vueDemo No description
npm WARN vueDemo No repository field.
npm WARN vueDemo No README data
npm WARN vueDemo No license field.

+ [email protected]
added 91 packages from 70 contributors and audited 130 packages in 15.16s
found 0 vulnerabilities

 

你可能感兴趣的:(vue)