{
  "id": "cmake/generator-ninja-not-found",
  "signature": "CMake Error: Could not create named generator 'Ninja'. Generator 'Ninja' is not available. Use 'cmake --help' to see a list of available generators.",
  "signature_zh": "CMake 错误：无法创建名为 'Ninja' 的生成器。生成器 'Ninja' 不可用。使用 'cmake --help' 查看可用生成器列表。",
  "regex": "CMake Error: Could not create named generator 'Ninja'\\. Generator 'Ninja' is not available\\. Use 'cmake --help' to see a list of available generators\\.",
  "domain": "cmake",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "CMake was invoked with -GNinja but Ninja is not installed or not in PATH, or the CMake installation does not include the Ninja generator (e.g., minimal install).",
  "root_cause_type": "generic",
  "root_cause_zh": "CMake 使用 -GNinja 调用，但 Ninja 未安装或不在 PATH 中，或者 CMake 安装不包含 Ninja 生成器（例如，最小安装）。",
  "versions": [
    {
      "version": "3.14",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.20",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.24",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.27",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Reinstalling CMake without selecting the Ninja generator option",
      "why_fails": "The Ninja generator is part of CMake's built-in generators; a reinstall without ensuring Ninja is in PATH does not help.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting CMAKE_GENERATOR to Ninja in CMakeLists.txt",
      "why_fails": "The generator is selected before CMakeLists.txt is parsed, so this setting has no effect; the error occurs at the configuration stage.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using -G \"Ninja Multi-Config\" as a substitute",
      "why_fails": "If Ninja is not installed, the multi-config generator also fails because it requires the same underlying build tool.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Install Ninja: on Ubuntu, run 'sudo apt-get install ninja-build'; on macOS, 'brew install ninja'; on Windows, download from https://ninja-build.org/ and add to PATH.",
      "success_rate": 0.95,
      "how": "Install Ninja: on Ubuntu, run 'sudo apt-get install ninja-build'; on macOS, 'brew install ninja'; on Windows, download from https://ninja-build.org/ and add to PATH.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a different generator such as Unix Makefiles: cmake -G \"Unix Makefiles\" ..",
      "success_rate": 0.9,
      "how": "Use a different generator such as Unix Makefiles: cmake -G \"Unix Makefiles\" ..",
      "condition": "",
      "sources": []
    },
    {
      "action": "If Ninja is installed but not in PATH, specify the full path: cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja ..",
      "success_rate": 0.85,
      "how": "If Ninja is installed but not in PATH, specify the full path: cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja ..",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "安装 Ninja：在 Ubuntu 上运行 'sudo apt-get install ninja-build'；在 macOS 上运行 'brew install ninja'；在 Windows 上从 https://ninja-build.org/ 下载并添加到 PATH。",
    "使用其他生成器，例如 Unix Makefiles：cmake -G \"Unix Makefiles\" ..",
    "如果 Ninja 已安装但不在 PATH 中，请指定完整路径：cmake -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja .."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.95,
  "resolvable": "true",
  "first_seen": "2023-07-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}