webdriver-manager update throwing an error “Invali

2019-07-23 13:22发布

问题:

I am new to protractor so please go easy on me.

I am facing the below error while running the command:

webdriver-manager update --proxy http://proxy.companyname.com:portnumber

webdriver-manager: using local installed version 12.1.1
[17:33:49] I/config_source - curl -oC:\Users\xyz\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\gecko-response.json 'http://proxy.company.com:port/repos/mozilla/geckodriver/releases' -H 'host:api.github.com'
[17:33:49] I/downloader - curl -om\node_modules\webdriver-manager\selenium/selenium-server-standalone-3.141.59.jar 'http://proxy.company.com:port/3.141/selenium-server-standalone-3.141.59.jar' -H 'host:selenium-release.storage.googleapis.com'
[17:33:49] I/update - selenium standalone: file exists \node_modules\webdriver-manager\selenium\selenium-server-standalone-3.141.59.jar
[17:33:49] I/update - selenium standalone: selenium-server-standalone-3.141.59.jar up to date
[17:33:49] I/downloader - curl -oC:\Users\731320\AppData\Roaming\npm\node_modules\webdriver-manager\selenium/chromedriver_2.46.zip 'http://proxy.company.com:port/2.46/chromedriver_win32.zip' -H 'host:chromedriver.storage.googleapis.com'
[17:33:49] I/update - chromedriver: unzipping chromedriver_2.46.zip

C:\Users\xyx\AppData\Roaming\npm\node_modules\webdriver-manager\node_modules\adm-zip\zipFile.js:66
                        throw Utils.Errors.INVALID_FORMAT;
                        ^
Invalid or unsupported zip format. No END header found

Because of which when I am trying to kickstart the selenium server I am getting error:

      Error: Invalid or corrupt jarfile 
      C:\Users\xyz\AppData\Roaming\npm\node_modules\webdriver- 
       manager\selenium\selenium-server-standalone-3.141.59.jar
      [17:39:21] I/start - Selenium Standalone has exited with code 1

I have also tried to manually place the selenium jar file in the folder, but that didn't work.

Could any one assist me on this?

回答1:

Try the below command from your project folder after npm i webdriver-manager.

node node_modules/protractor/bin/webdriver-manager update

Hope it helps you