Skip to content
Latchkey

Deno "deno: command not found" in CI (setup-deno)

The shell could not find a deno executable. GitHub-hosted runners do not include Deno by default, so a step needs to install it (usually denoland/setup-deno) before any deno command runs.

What this error means

A step calling deno ... fails with "deno: command not found" and exit code 127, before any Deno output appears.

deno
/home/runner/work/_temp/script.sh: line 1: deno: command not found
Error: Process completed with exit code 127.

Common causes

No setup-deno step in the job

The workflow never installs Deno, so the runner has no deno binary on PATH.

The deno command runs before setup

A deno step is ordered before the setup-deno step, so Deno is not yet installed when it runs.

How to fix it

Add setup-deno before deno steps

  1. Add the denoland/setup-deno action early in the job.
  2. Ensure every deno command runs after it.
  3. Pin a deno-version so the runtime is deterministic.
.github/workflows/ci.yml
- uses: denoland/setup-deno@v2
  with:
    deno-version: v2.x
- run: deno --version

Confirm Deno is on PATH

Log deno --version right after setup so a missing install fails visibly at the right place.

Terminal
deno --version

How to prevent it

  • Install Deno with setup-deno before any deno step.
  • Pin deno-version for reproducible runs.
  • Add a deno --version step to verify the install.

Related guides

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