Skip to content
Latchkey

Storybook "command not found" - Fix in CI

The CI shell could not find the storybook binary. Either Storybook is not installed in this job, a production-only install skipped it, or the script invokes a binary name that no longer exists.

What this error means

The step exits 127 with storybook: command not found or build-storybook: not found.

node
sh: 1: storybook: command not found
npm ERR! code 127
npm ERR! command failed

Common causes

Storybook not installed

The storybook package is missing, or npm ci --omit=dev pruned it before this step.

Old binary name

Recent Storybook unified the CLI to storybook build; an old build-storybook script may no longer resolve.

How to fix it

Install Storybook and use the current CLI

  1. Install storybook as a dev dependency.
  2. Call it through npm scripts so it resolves from node_modules/.bin.
Terminal / package.json
npm install -D storybook
# package.json script
"build-storybook": "storybook build"

Do not prune dev deps before this step

  1. Ensure devDependencies are present when the Storybook step runs.
Terminal
npm ci   # not --omit=dev when building Storybook

How to prevent it

  • Invoke Storybook via npm scripts, not a global binary.
  • Keep dev dependencies installed for build jobs.

Frequently asked questions

What causes "storybook not found"?
The storybook package is missing, or npm ci --omit=dev pruned it before this step.
How do I fix storybook not found?
Install Storybook and use the current CLI

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card