Shopify "shopify: command not found" in CI
The Shopify CLI is distributed as the @shopify/cli npm package. A runner that has not installed it globally, or a project that installed it as a dev dependency, has no shopify executable on PATH, so the shell cannot find it.
What this error means
A shopify theme ... or shopify app ... step fails with "shopify: command not found" and exit code 127.
Shopify CLI
/home/runner/work/_temp/script.sh: line 1: shopify: command not found
Error: Process completed with exit code 127.Common causes
The CLI is not installed on the runner
The job assumes a global shopify binary that the base image does not include.
It is a project dev dependency, not global
@shopify/cli is in package.json but a bare shopify is not on PATH; it must be run via the package runner.
How to fix it
Run the CLI through npx
Invoke the project-local CLI without a global install so the exact pinned version runs.
Terminal
npx shopify theme push --store mystore.myshopify.comInstall the CLI for the job
- Add
@shopify/clito the project, or install it for the step. - Use
npx shopifyor the local bin path to invoke it. - Re-run the command.
Terminal
npm install -g @shopify/cli@latest
shopify versionHow to prevent it
- Pin
@shopify/cliin package.json and call it via npx. - Avoid relying on a global CLI the base image may not have.
- Cache node_modules so the CLI is present each run.
Related guides
Shopify CLI "access token ... invalid" / not authenticated in CIFix Shopify CLI authentication failures in CI - "shopify theme" reports the Theme Access password or CLI toke…
Shopify "theme check" reports offenses (non-zero exit) in CIFix Shopify "theme check" failing CI - the linter found offenses in Liquid templates and exits non-zero, ofte…
Shopify "shopify app deploy" failed in CIFix "shopify app deploy" failures in CI - releasing an app version fails on missing Partners authentication,…