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.
sh: 1: storybook: command not found
npm ERR! code 127
npm ERR! command failedCommon 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
- Install storybook as a dev dependency.
- Call it through npm scripts so it resolves from node_modules/.bin.
npm install -D storybook
# package.json script
"build-storybook": "storybook build"Do not prune dev deps before this step
- Ensure devDependencies are present when the Storybook step runs.
npm ci # not --omit=dev when building StorybookHow to prevent it
- Invoke Storybook via npm scripts, not a global binary.
- Keep dev dependencies installed for build jobs.