You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac系统VS中安装WebdriverIO遇依赖冲突错误求助

解决WebdriverIO安装时的依赖冲突及配置失败问题

方案1:升级兼容WebdriverIO v8的Reporter版本

核心问题是wdio-cucumberjs-json-reporter@4.4.3仅支持WebdriverIO v7版本,而你安装的@wdio/cucumber-framework是v8.x,升级reporter到兼容v8的版本即可解决:

  • 卸载旧版reporter:
    npm uninstall wdio-cucumberjs-json-reporter
  • 安装支持v8的最新稳定版(当前v5.x及以上版本适配WebdriverIO v8):
    npm install wdio-cucumberjs-json-reporter --save-dev
  • 重新运行配置命令:
    npx wdio config

方案2:降级WebdriverIO框架到v7版本

若暂时不想升级reporter,可将框架版本降到与reporter的peer依赖匹配的v7.x系列:

  • 卸载当前v8版本的框架:
    npm uninstall @wdio/cucumber-framework
  • 安装v7.x的最新稳定版:
    npm install @wdio/cucumber-framework@7 --save-dev
  • 重新运行配置命令:
    npx wdio config

方案3:忽略peer依赖冲突(临时方案)

如果只是临时需要绕过冲突,可使用npm的参数强制忽略peer依赖检查,但此方案可能存在潜在兼容性风险,不推荐长期使用:

  • 重新执行安装并添加参数:
    npm install --legacy-peer-deps
  • 再运行配置命令:
    npx wdio config

内容的提问来源于stack exchange,提问作者shreedivya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 14:42:40