nodejs:UnhandledPromiseRejectionWarning:WebDriverError:未知错误:Chrome无法启动:异常退出

时间:2018-06-03 20:43:59

标签: javascript node.js selenium-webdriver selenium-chromedriver

我当前的脚本如下:

var webdriver = require('selenium-webdriver'); //no errors here
var driver = new webdriver.Builder().forBrowser('chrome').build(); //causes problems

错误如下所示:

(node:27161) UnhandledPromiseRejectionWarning: WebDriverError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 4.15.0-kali2-amd64 x86_64)
at Object.checkLegacyResponse (/root/automate/node_modules/selenium-webdriver/lib/error.js:585:15)
at parseHttpResponse (/root/automate/node_modules/selenium-webdriver/lib/http.js:533:13)
at Executor.execute (/root/automate/node_modules/selenium-webdriver/lib/http.js:468:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:27161) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:27161) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

谷歌浏览器浏览器永远不会启动。

我的节点版本是

V10.3.0

npm版本是

6.1.0

chromedriver版本是

2.10.267518

我的操作系统是Kali-Linux

Google Chrome版本:

67.0.3396.62

非常感谢任何帮助!

0 个答案:

没有答案