2017-04-05 86 views
1

我想安装使用npm的chromedriver,我在我的公司代理。我看到以下错误。Chrome驱动器安装失败代理

这是我做的,到目前为止

  1. 我已经把我像 NPM配置设置代理http://proxy.na.xxxxx.com:8080 NPM配置设置代理的代理配置http://proxy.na.xxxxx.com

  2. 我清除了缓存 NPM配置删除代理

  3. npm install chromedriver --ignore_ssl

没有他们的帮助


ChromeDriver installation failed Error with http request: { 'cache-control': 'no-cache', 
    pragma: 'no-cache', 
    'content-type': 'text/html; charset=utf-8', 
    'proxy-connection': 'close', 
    connection: 'close', 
    'content-length': '727' } 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm WARN [email protected] No license field. 
npm ERR! Windows_NT 6.1.7601 
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\#####\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "chromedriver" 
npm ERR! node v6.9.2 
npm ERR! npm v4.0.5 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node install.js` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node install.js'. 
npm ERR! Make sure you have the latest version of node.js and npm installed. 
npm ERR! If you do, this is most likely a problem with the chromedriver package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node install.js 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs chromedriver 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls chromedriver 

回答

1

试试这个:

npm install [email protected] --chromedriver-cdnurl=http://chromedriver.storage.googleapis.com 

模块具体cdnurl与HTTP(而不是HTTPS)选项(chromedriver-cdnurl)将解决在某些企业代理环境中发生了严重的ca认证检查问题。