你好,我是webdriverio的新手,我试图运行命令。
DETECT_CHROMEDRIVER_VERSION=true npm i在我得到以下错误之后
npm WARN @hint/hint-amp-validator@2.10.11 requires a peer of hint@^6.0.0 but none is
installed. You must install peer dependencies yourself.
npm WARN allure-mochajs@2.0.0-beta.3 requires a peer of mocha@^5.2.0 but none is
installed. You must install peer dependencies yourself.
npm WARN eslint-config-standard@13.0.1 requires a peer of eslint@>=6.0.1 but none is
installed. You must install peer dependencies yourself.
npm WARN wdio-chromedriver-service@6.0.4 requires a peer of @wdio/cli@^6.0.0 but none
is installed. You must install peer dependencies yourself.
npm WARN wdio-mochawesome-reporter@4.0.0 requires a peer of @wdio/cli@^5.8.4 but none
is installed. You must install peer dependencies yourself.
npm WARN wdio-mochawesome-reporter@4.0.0 requires a peer of mochawesome-report-
generator@^3.1.5 but none is installed. You must install peer dependencies yourself.
npm WARN cnn-content-hub-automation@ No repository field.
npm WARN cnn-content-hub-automation@ No license field.
audited 1875 packages in 12.786s
found 57 vulnerabilities (54 moderate, 3 high)
run `npm audit fix` to fix them, or `npm audit` for details发布于 2022-01-18 19:40:24
检测ChromeDriver版本
有时,NPM包版本可能并不总是与您的谷歌铬版本兼容。要获得与Chrome版本相对应的ChromeDriver,可以使用npm属性detect_chromedriver_version。
npm install chromedriver --detect_chromedriver_version或者将属性添加到.npmrc文件中。
detect_chromedriver_version=true另一个选项是使用环境变量DETECT_CHROMEDRIVER_VERSION.。
DETECT_CHROMEDRIVER_VERSION=true npm install chromedriver注意:当提供属性
detect_chromedriver_version时,chromedriver_version和chromedriver_filepath属性将被忽略。
解决方案
而不是:
DETECT_CHROMEDRIVER_VERSION=true npm i你需要使用:
DETECT_CHROMEDRIVER_VERSION=true npm install chromedriverhttps://stackoverflow.com/questions/70745566
复制相似问题