wechaty: ChromeDriver could not be found

This is just an information since others have the same problem… or if you know the reason.

I setup wechaty on two new machines (showing it to a friend) and both times hit this error on trying to run the demo. However I don’t always hit this problem - other machines have been OK.

ChromeDriver could not be found

INFO Wechaty v#git[044d24f 0.6.67] initializing...
ERR PuppetWebBrowserDriver initChromeDriver() Wechaty require `chrome-driver` to be installed.
ERR PuppetWebBrowser init() exception: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
WARN PuppetWebBrowser quit() exception: Cannot read property 'close' of undefined
WARN PuppetWebBrowser driver.quit() exception: Cannot read property 'close' of undefined
ERR PuppetWeb initBrowser() exception: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
ERR PuppetWeb init() exception: Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
    at Error (native)
    at ServiceBuilder (/Users/dc/dev/rikai/ta-bot/wechaty/node_modules/selenium-webdriver/chrome.js:191:13)
    at getDefaultService (/Users/dc/dev/rikai/ta-bot/wechaty/node_modules/selenium-webdriver/chrome.js:280:22)
    at Function.createSession (/Users/dc/dev/rikai/ta-bot/wechaty/node_modules/selenium-webdriver/chrome.js:700:44)
    at createDriver (/Users/dc/dev/rikai/ta-bot/wechaty/node_modules/selenium-webdriver/index.js:167:33)
    at Builder.build (/Users/dc/dev/rikai/ta-bot/wechaty/node_modules/selenium-webdriver/index.js:639:16)
    at BrowserDriver.<anonymous> (/Users/dc/dev/rikai/ta-bot/wechaty/src/puppet-web/browser-driver.js:79:26)
    at next (native)
    at /Users/dc/dev/rikai/ta-bot/wechaty/src/puppet-web/browser-driver.js:7:65
    at __awaiter (/Users/dc/dev/rikai/ta-bot/wechaty/src/puppet-web/browser-driver.js:3:12)
INFO Bot error: Error: The ChromeDriver could not be found on the current PATH. Please download the latest version of the ChromeDriver from http://chromedriver.storage.googleapis.com/index.html and ensure it can be found on your PATH.
(node:21414) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: can not say before login
(node:21414) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot read property 'quit' of undefined

To fix this i reinstalled just

npm i chromedriver

and everything was OK.

Now I noticed the URL points to a google domain.

http://chromedriver.storage.googleapis.com

But since it came from ©npm i was able to install OK.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I think this needs to be documented then, as currently it will (sometimes?) leave an incomplete install. One way would be an installer/setup script, but that would need to also maybe support windows which would be a pain.

Is there a way to use PhantomJS in development, or is that just for testing? I tried:

const TestConfig = {
  "wechaty": {
    "profile": "TABOT",
    "DEFAULT_HEAD": "phantomjs", // chrome
    "DEFAULT_PUPPET": "web",
    "DEFAULT_PROFILE": "demo",
    "DEFAULT_PORT": 8788,
    "DEFAULT_PROTOCOL": "io|0.0.1",
    "DEFAULT_TOKEN": "WECHATY_IO_TOKEN",
    "DEFAULT_APIHOST": "api.wechaty.io",
    "CMD_CHROMIUM": "/wechaty/bin/xvfb-chromium"
  }
}

const WcBot = Wechaty.instance( TestConfig.wechaty );

hi @zixia ,

The program is running fine now on another windows machine, the chromedriver path must use .exe in the ‘lib’ folder.

After that, the demo script works fine. Thank you for your help.

@zixia Anyway, thank you so much for your help! I really appreciate it!

Your docker solution is awesome! I’ll keep going on bot development with docker solution, as well as figure out how it works on win32 (hopefully someday😅).

BTW, I was so much impressed by your Wechaty 101 Video. Honestly, I have so much essentials to learn - from Docker thru CI, and Testing thru Building. Thanks to Wechaty project! It inspires me a lot!