Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running storybook - sh: 1: start-storybook: not found

I am facing error running storybook.... even on a clean installation.

 npm run storybook

> @ storybook /media/programmersedge/New_Volume/devs/demostorybook
> start-storybook -p 9001 -c .storybook

sh: 1: start-storybook: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ storybook: `start-storybook -p 9001 -c .storybook`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @ storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I am using the latest storybook version. and my node version is 6.11.1 and npm version is 5.5.1

I also tried installing storybook with yarn but I am facing the same problem yarn version 1.3.2

like image 324
besrabasant Avatar asked Jan 24 '18 08:01

besrabasant


3 Answers

This error is due to the node_modules folder. If you delete that folder and run npm install. it will work. Mostly due to cropped dependency linking If you have configured a react app by yourself then the storyboard may need some other configuration. If you use create-react-app or react-npm-package-developer for React then it should work

like image 150
mhnpd Avatar answered Sep 19 '22 16:09

mhnpd


In most cases, you need to manually install @storybook/cli by running

# For npm
npm i -D @storybook/cli

# For yarn
yarn add -D @storybook/cli
like image 22
imedadel Avatar answered Sep 19 '22 16:09

imedadel


I ran into the same issue, the binary has been renamed from storybook to start-storybook.

yarn start-storybook

You can check the binary name looking into the node_modules/.bin directory:

ls node_modules/.bin/ |grep storybook
like image 21
mabahamo Avatar answered Sep 19 '22 16:09

mabahamo