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

CumulusCI用sf CLI创建Scratch Org时出现模块未找到错误

在CumulusCI中使用sf CLI创建Scratch Org遇到的问题

我尝试在CumulusCI中使用sf CLI替代sfdx,通过自定义流创建Salesforce Scratch Org。cumulusci.yml中的流配置如下:

flows:
  create_dynamic_scratch_org:
    steps:
      1:
        task: create_scratch_org_dynamic

tasks:
  create_scratch_org_dynamic:
    class_path: cumulusci.tasks.command.Command
    options:
      command: >
        sf org create scratch --definition-file config/project-scratch-def.json
        --duration-days 30 --alias {{ runtime.alias }} --set-default --wait 10

运行以下命令:

cci flow run create_dynamic_scratch_org --org FinalTest

后出现错误,错误发生在输出以下内容之后:

Creating scratch org with command: sfdx force:org:create --json -f config/project-scratch-def.json ...

错误堆栈信息:

Error: Cannot find module 'C:\Devops\ECMayAutoamtion\undefined'
at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
...
Node.js v22.13.1

令我困惑的是,我在命令中使用的是sf,但系统却打印sfdx命令并抛出NodeJS堆栈跟踪。

已尝试的操作

  • 确认sf CLI已安装且在命令行中可正常使用。
  • 验证YAML语法正确。
  • 确保config/project-scratch-def.json存在且有效。
  • 通过pip install --upgrade cumulusci升级CumulusCI。

疑问

  • 为何CumulusCI仍尝试运行sfdx,尽管我在命令字符串中使用的是sf?
  • 在此场景下,导致“Cannot find module ... undefined”的原因是什么?
  • 如何解决此问题并确保CCI正确使用sf CLI创建Scratch Org?

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.12 20:42:12