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

WebdriverIO中Selenium standalone服务初始化失败问题求助

解决WDIO启动时找不到selenium-standalone服务的问题

问题场景

执行npm run wdio.conf.ts时触发如下错误:

Failed to initilialise launcher service unknown: Error: Couldn't find plugin "selenium-standalone" service, neither as wdio scoped package "@wdio/selenium-standalone-service" nor as community package "wdio-selenium-standalone-service". Please make sure you have it installed!

当前配置信息:

  • wdio.conf.ts中的services配置:
    services: [['selenium-standalone', { drivers: { firefox:  true, chrome: true, chromiumedge: true } }]],
    
  • package.json已声明依赖:
    "@wdio/cli": "^8.15.6",
    "@wdio/selenium-standalone-service": "^8.15.0"
    

排查与解决步骤

  • 重新安装依赖:删除node_modules文件夹和package-lock.json(或yarn.lock)文件,执行npm install确保依赖完整安装
  • 确认配置文件导出格式:检查wdio.conf.ts是否正确导出配置对象,示例格式如下:
    export const config = {
      // 其他配置项
      services: [['selenium-standalone', { drivers: { firefox: true, chrome: true, chromiumedge: true } }]],
      // 其他配置项
    }
    
  • 验证版本兼容性:确保使用的Node.js版本符合WDIO 8.x的要求(推荐16.x或18.x),避免版本不匹配导致的模块加载异常
  • 清理WDIO缓存:执行npx wdio clean清除缓存后,重新运行启动命令

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.12 10:34:53