"E/启动器-未创建会话:Chrome版本必须在71到75之间"尝试在VSCode中为有角度的应用程序运行E2E时
我试图在VSCode中为Angular应用程序运行e2e(命令:ng e2e),但出现以下错误.
I am trying to run the e2e for an Angular application in VSCode (command: ng e2e) and I get the below error.
我的环境:
- 赢10
- VS代码版本:1.37.1
- Chrome版本:76.0.3809.132版(正式内部版本)(64位)
如何更新chromedriver以匹配Chrome版本?
How could I update the chromedriver to match Chrome version?
Your global Angular CLI version (7.3.8) is greater than your local
version (7.3.5). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
22% building 103/109 modules 6 active ...e\workflow-manager-table.component.scssBrowserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`
Date: 2019-09-03T18:20:59.131Z
Hash: 3ced9271ad10fcdd845e
Time: 14922ms
chunk {es2015-polyfills} es2015-polyfills.js, es2015-polyfills.js.map (es2015-polyfills) 284 kB [initial] [rendered]
chunk {main} main.js, main.js.map (main) 4.17 MB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.11 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 7.93 MB [initial] [rendered]
WARNING in ./node_modules/@angular/material/esm5/tree.es5.js 38:63-88
"export 'CDK_TREE_NODE_OUTLET_NODE' was not found in '@angular/cdk/tree'
WARNING in ./node_modules/@angular/material/esm5/tree.es5.js 168:35-60
"export 'CDK_TREE_NODE_OUTLET_NODE' was not found in '@angular/cdk/tree'
[11:20:59] I/file_manager - creating folder C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\node_modules\webdriver-manager\selenium
[11:20:59] I/config_source - curl -oC:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/
i 「wdm」: Compiled with warnings.
[11:20:59] I/downloader - curl -oC:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\node_modules\webdriver-manager\selenium/chromedriver_2.46.zip https://chromedriver.storage.googleapis.com/2.46/chromedriver_win32.zip
[11:20:59] I/update - chromedriver: unzipping chromedriver_2.46.zip
[11:21:00] I/launcher - Running 1 instances of WebDriver
[11:21:00] I/direct - Using ChromeDriver directly...
DevTools listening on ws://127.0.0.1:59746/devtools/browser/8a7f04ec-5be2-40bb-b68f-463b377c9c2b
[11:21:01] E/launcher - session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17763 x86_64)
[11:21:01] E/launcher - SessionNotCreatedError: session not created: Chrome version must be between 71 and 75
(Driver info: chromedriver=2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1),platform=Windows NT 10.0.17763 x86_64)
at Object.checkLegacyResponse (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: WebDriver.createSession()
at Function.createSession (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
at Function.createSession (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\selenium-webdriver\chrome.js:761:15)
at Direct.getNewDriver (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\built\driverProviders\direct.js:77:33)
at Runner.createBrowser (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\built\runner.js:195:43)
at q.then.then (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\protractor\built\runner.js:339:29)
at _fulfilled (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\q\q.js:834:54)
at C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\q\q.js:863:30
at Promise.promise.promiseDispatch (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\q\q.js:796:13)
at C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\q\q.js:556:49
at runSingle (C:\_VSTS\OkhamaMD\OkhamaMDWebDemo\UI\node_modules\q\q.js:137:13)
[11:21:01] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
那是因为您指出的是Chrome version: Version 76.0.3809.132
.
通过更新webdriver-manager&可以轻松解决此问题.量角器:
that's because you have Chrome version: Version 76.0.3809.132
as you pointed out.
This problem should be easily resolved by updating webdriver-manager & protractor:
npm install -g webdriver-manager protractor && webdriver-manager update
如果这不起作用,请先尝试将其卸载,然后重新安装最新版本:
If that didn't work, try uninstalling it first, then re-install the latest version:
npm uninstall -g webdriver-manager protractor
然后
npm install -g webdriver-manager protractor
和webdriver-manager update