GitHub Actions "/usr/bin/bash: line N: command not found"
A run step invoked a binary the runner cannot resolve. Bash searches PATH, finds nothing, and exits the step with code 127. The shell itself is fine; the named command is missing or misspelled.
What this error means
A run step fails immediately on the line that calls a CLI tool, printing the tool name followed by "command not found".
github-actions
/usr/bin/bash: line 2: pnpm: command not found
##[error]Process completed with exit code 127.Common causes
Tool was never installed on the runner
The image does not ship the binary, and no setup-* step (or install command) ran before the step that uses it.
Tool installed but not added to PATH
An installer placed the binary in a custom directory that was not appended to GITHUB_PATH, so later steps cannot see it.
Typo in the command name
A misspelled binary (for example "pyhton" or "yanr") never matches anything on PATH.
How to fix it
Install the tool before you use it
- Add the relevant setup action or install command as an earlier step in the same job.
- Confirm the version line runs successfully before the failing step.
- Re-run; the binary now resolves on PATH.
.github/workflows/ci.yml
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm --version
- run: pnpm install --frozen-lockfileAdd a custom install dir to PATH
- Append the install directory to GITHUB_PATH in the install step.
- PATH changes via GITHUB_PATH apply to subsequent steps, not the current one.
- Re-run and verify the command resolves.
install + GITHUB_PATH
- run: |
curl -sSL https://example.com/install.sh | sh -s -- --bin-dir "${HOME}/.local/bin"
echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
- run: mytool --versionHow to prevent it
- Pin a setup action for every toolchain your workflow depends on.
- Print "tool --version" right after install to fail fast with a clear message.
Related guides
GitHub Actions run step "Permission denied" running a scriptFix the GitHub Actions run-step error "Permission denied" when executing a checked-in script - the file lacks…
GitHub Actions GITHUB_PATH append not taking effectFix the GitHub Actions issue where appending to GITHUB_PATH does not update PATH in the current step.
GitHub Actions "Process completed with exit code 1" in run with set -eFix a GitHub Actions run step that fails with exit code 1 due to the default bash set -e - any failing comman…