Skip to content
Latchkey

Cargo "no such command" - Missing Cargo Subcommand in CI

Cargo found no built-in subcommand by that name and no cargo-X binary on PATH. The subcommand is a separate plugin (like cargo-audit or cargo-nextest) that was never installed on the runner.

What this error means

A step running cargo audit, cargo nextest, cargo deny, or similar fails with error: no such command: X`, often with a "did you mean" hint. Built-in commands like build and test` work - only the external subcommand is missing.

cargo output
error: no such command: `nextest`

	Did you mean `test`?

	View all installed commands with `cargo --list`
	Find a package to install `nextest` with `cargo search cargo-nextest`

Common causes

The subcommand plugin isn’t installed

Subcommands like cargo-nextest, cargo-audit, cargo-deny, and cargo-tarpaulin are separate crates. Cargo resolves cargo X to a cargo-X binary on PATH; if it isn’t installed, there is nothing to run.

Installed but not on PATH

The plugin was installed to ~/.cargo/bin, but a later step runs in a shell where that directory isn’t on PATH, so the cargo-X binary isn’t found.

How to fix it

Install the subcommand

Install the plugin crate so the cargo-X binary exists. Prebuilt-binary installers are much faster than cargo install in CI.

.github/workflows/ci.yml
# fast: prebuilt binary
- uses: taiki-e/install-action@v2
  with:
    tool: cargo-nextest
# or build it
cargo install cargo-nextest --locked

List what is actually available

See which subcommands Cargo can find, and confirm ~/.cargo/bin is on PATH.

Terminal
cargo --list
echo "$PATH" | tr ':' '\n' | grep cargo

How to prevent it

  • Install cargo subcommands explicitly in CI before using them.
  • Prefer prebuilt-binary installers over cargo install to save build time.
  • Cache ~/.cargo/bin so installed subcommands persist across runs.

Related guides

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