Ali Tarlaci
Ali Tarlaci

Reputation: 151

npm install chromedriver is not working properly

How to install newer version of chrome driver besides;

npm install chromedriver,
npm install chromedriver --chromedriver_cdnurl=https://npm.taobao.org/mirrors/chromedriver,
npm install chromedriver --chromedriver_version=LATEST ,
npm install chromedriver --chromedriver-force-download

I get

SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 91
Current browser version is 94.0.4606.71 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

This commands are not working to update chromedriver version. I tried to uninstall it first but I was not able to uninstall chromedriver dependancy.

anyone knows any other command that I can try?

Upvotes: 5

Views: 21054

Answers (2)

Siddharth Mittal
Siddharth Mittal

Reputation: 119

Let's initially understand the problem

Google chrome brings update on regular intervals & If our code runs on older version then it brings compatibility Issues so we need to update the chrome binaries for it.

For Updating chrome driver you need to use the following command

npm install chromedriver --chromedriver_version=LATEST

But sometimes after you are done with running this command you can face same issue again. It is bit wired so here is the solution for it.

Let me take a example initally "chromedriver": "^109.0.0" was installed now you want to update it to latest version

  1. Go to package.json

  2. Removed the existing chrome version

  3. Now press ctrl+space,you will see the latest package,choose it

  4. Again run the below command

    npm install chromedriver--chromedriver_version=LATEST
    

Upvotes: 1

Syed Suhail
Syed Suhail

Reputation: 21

If your trying to update the chromedriver which is latest and not in NPM. Here is the steps.

  1. Download the latest version of chromedriver from - https://chromedriver.chromium.org/downloads
  2. Intall the chromedriver globally - npm install -g chromedriver --chromedriver_filepath=/Path for download files /Downloads/chromedriver_mac64.zip2.
  3. Latest version of chromedriver will be installed.

Upvotes: 2

Related Questions