首页 > 解决方案 > 安装 chai 后,我将 chai-webdriverio 作为开发依赖项安装,但出现此错误

问题描述

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-webdriverwebdriver-io

解决方案


我能够通过运行解决这个问题

npm install chai-webdriverio --force

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


推荐阅读