Skip to content
Latchkey

CMake "No such preset" / invalid CMakePresets.json in CI

CMake could not use the requested preset: the name does not exist in CMakePresets.json, or the file declares a preset schema version newer than the CMake on the runner supports.

What this error means

cmake --preset fails with "No such preset in CMakePresets.json: ci" or "Unrecognized \"version\" field", so configuration never starts.

cmake
CMake Error: No such preset in /home/runner/work/app/app:

  ci-release

CMake Error: Could not read presets from /home/runner/work/app/app: Unrecognized
"version" field

Common causes

The preset name does not match the file

The --preset value has a typo or refers to a preset not defined in CMakePresets.json.

The preset schema version exceeds the runner CMake

CMakePresets.json declares a version newer than the installed CMake supports, so it cannot be read.

How to fix it

Use an existing preset name

  1. List available presets with cmake --list-presets.
  2. Pass a name that exists in CMakePresets.json.
  3. Keep CI and local preset names identical.
Terminal
cmake --list-presets
cmake --preset ci-release

Match the CMake version to the preset schema

Install a CMake new enough for the preset "version" field, or lower the field to a supported schema.

.github/workflows/ci.yml
- uses: lukka/get-cmake@latest
  with:
    cmakeVersion: '3.28.3'

How to prevent it

  • Verify preset names with cmake --list-presets in CI.
  • Pin a CMake new enough for the CMakePresets.json schema version.
  • Keep one preset file used by both local and CI builds.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →