【问题标题】:"ERESOLVE unable to resolve dependency tree" when setting up a new project using wdio-v7使用 wdio-v7 设置新项目时出现“ERESOLVE 无法解析依赖关系树”
【发布时间】:2021-02-19 09:51:42
【问题描述】:

我正在尝试使用wdio-v7 建立一个新项目, 首先我跑了npm init -y 然后npm install @wdio/cli --save-dev 在运行npx wdio config -y 之后,我收到了这个:

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: example-test@1.0.0
    npm ERR! Found: @wdio/cli@7.0.5
    npm ERR! node_modules/@wdio/cli
    npm ERR!   dev @wdio/cli@"^7.0.5" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer @wdio/cli@"^6.0.0" from wdio-chromedriver-service@6.0.4
    npm ERR! node_modules/wdio-chromedriver-service
    npm ERR!   dev wdio-chromedriver-service@"*" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    npm ERR! 
    
    Initialize WebdriverIO and setup configuration in your current project.
    
    Documentation: https://webdriver.io
    @wdio/cli (v7.0.5)
    

我尝试使用--force, or --legacy-peer-deps,但没有成功。

【问题讨论】:

    标签: webdriver-io


    【解决方案1】:

    这很奇怪,看起来npx wdio config -y正在尝试安装旧版本的 chrome 驱动程序服务。

    尝试手动安装chromedriver服务或更新package.json中的版本

    "wdio-chromedriver-service": "^7.0.0"
    

    确保您满足 webdriverio 的最低要求

    https://webdriver.io/docs/gettingstarted#system-requirements

    至少安装 v12.16.1 或更高版本,因为这是最旧的活动 LTS 版本 只有已成为或将成为 LTS 版本的版本才是 官方支持

    【讨论】:

    • 今天我再次尝试npx wdio config -y,它成功了。它安装了最新版本的wdio-chromedriver-service
    猜你喜欢
    • 2021-08-04
    • 2021-06-23
    • 2021-09-25
    • 1970-01-01
    • 2021-03-24
    • 2022-01-25
    • 1970-01-01
    • 2022-06-14
    • 2022-01-08
    相关资源
    最近更新 更多