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

求助:执行after:run事件时抛出spawn cucumber-json-formatter ENOENT错误

解决spawn cucumber-json-formatter ENOENT错误

这个错误的核心原因是系统无法找到cucumber-json-formatter可执行文件,以下是具体解决步骤:

  • 安装cucumber-json-formatter

    • 若使用npm管理依赖,执行:
      npm install cucumber-json-formatter --save-dev
      
    • 系统级安装(根据操作系统选择):
      • macOS:brew install cucumber-json-formatter
      • Debian/Ubuntu:sudo apt-get install cucumber-json-formatter
      • Windows:下载对应系统的二进制文件,将其放入系统PATH包含的目录中
  • 验证可执行文件路径
    在终端执行cucumber-json-formatter --version,若能正常输出版本号,说明已在PATH中;若不行,需将安装路径添加到系统环境变量PATH里。
    如果是本地npm安装,可执行文件位于node_modules/.bin/目录下,可在插件代码中指定完整路径,例如:

    spawn('./node_modules/.bin/cucumber-json-formatter', [...args])
    
  • 检查插件配置
    确认after:run事件处理程序中,调用cucumber-json-formatter的命令路径正确,或通过cwd参数指定项目根目录,确保能找到本地安装的可执行文件。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.17 14:01:03