giggio / node-chromedriver

An installer and wrapper for Chromedriver.
Apache License 2.0
477 stars 182 forks source link

Windows install for use with Selenium #414

Closed Auto81 closed 1 year ago

Auto81 commented 1 year ago

Having some odd behaviour with using this on Windows machines. It works perfectly on Mac.

Running 'npm i -g chromedriver' succeeds, and then 'chromedriver' in cmd works as expected.

However when Selenium-JVM tried to start up this chromedriver it throws

Cannot run program "C:\Users\Auto81\AppData\Roaming\npm\chromedriver" (in directory "."): 
CreateProcess error=193, %1 is not a valid Win32 application)

Upon a closer look the first path location that gets returned seems to be a shell script?

C:\Users\Auto81>where chromedriver
C:\Users\Auto81\AppData\Roaming\npm\chromedriver
C:\Users\Auto81\AppData\Roaming\npm\chromedriver.cmd

If I delete the script via del %APPDATA%\npm\chromedriver, then Selenium is able to start the driver properly.

Only other related item I could find was https://github.com/giggio/node-chromedriver/issues/90