【问题标题】:After installing chai, i was installing chai-webdriverio as a dev dependency but i got this error安装 chai 后,我将 chai-webdriverio 作为开发依赖项安装,但出现此错误
【发布时间】:2021-04-30 15:43:09
【问题描述】:

npm i chai-webdriverio --save-dev

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: webdriverio@1.0.0
npm ERR! Found: chai@4.3.4
npm ERR! node_modules/chai
npm ERR!   dev chai@"^4.3.4" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer chai@"~4.0.1" from chai-webdriverio@1.0.0
npm ERR! node_modules/chai-webdriverio
npm ERR!   dev chai-webdriverio@"*" 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.

【问题讨论】:

    标签: selenium-webdriver webdriver-io


    【解决方案1】:

    我可以通过运行解决这个问题

    npm install chai-webdriverio --force

    注意:使用 --force 会禁用推荐的保护。

    【讨论】:

      【解决方案2】:

      另一种选择是安装所需的 chai 版本:

      npm install chai@4.0.1 --save-dev
      

      也许这更一致

      【讨论】:

        猜你喜欢
        • 2021-04-14
        • 1970-01-01
        • 2020-08-27
        • 1970-01-01
        • 2011-11-18
        • 2022-07-20
        • 2020-06-08
        • 1970-01-01
        • 2016-04-10
        相关资源
        最近更新 更多