Skip to content
Latchkey

pre-commit "Executable ... not found" for a hook language env in CI

pre-commit set up the hook environment but the entry point binary is not present. Usually the language runtime that pre-commit needs to build the isolated environment is absent from the runner.

What this error means

A hook fails with "Executable <name> not found" before it does any work, meaning the tool was never installed into the hook environment.

pre-commit
Executable `shellcheck` not found
Check the log at /root/.cache/pre-commit/pre-commit.log

Common causes

A system-language hook expects a preinstalled binary

Hooks with language: system do not install anything; they call a binary that must already be on the runner, and it is not.

The language runtime for the env is missing

For a language like golang, ruby, or node, if the runtime is not available pre-commit cannot build the env, so the executable never appears.

How to fix it

Install the required binary or runtime first

  1. Identify whether the hook is language: system (needs a preinstalled binary) or a managed language.
  2. Install that binary or runtime in an earlier step.
  3. Re-run so pre-commit finds or builds the executable.
.github/workflows/ci.yml
- run: sudo apt-get update && sudo apt-get install -y shellcheck
- run: pre-commit run --all-files

Provide the runtime for a managed language hook

Use the matching setup action so pre-commit can build the hook environment.

.github/workflows/ci.yml
- uses: actions/setup-go@v5
  with:
    go-version: '1.22'

How to prevent it

  • Install system-hook binaries explicitly on the runner.
  • Provision the language runtime each hook needs before running pre-commit.
  • Prefer managed-language hooks over language: system where possible.

Related guides

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