skip to Main Content

I have added this command in package.json:

"storybook": "start-storybook -p 9001 -c .storybook"

then run this command: pnpm run storybook, shows error like this:

> pnpm run storybook

> [email protected] storybook /Users/john/source/frontend/ui-component
> start-storybook -p 9001 -c .storybook

sh: start-storybook: command not found
 ELIFECYCLE  Command failed.

I have tried to install the dependencies follow this issue https://github.com/storybookjs/storybook/issues/311 and restart the visual studio code, still could not work. this is the dependencies I have already tried:

> pnpm list|grep "storybook"
@storybook/cli 7.0.10
@storybook/react 7.0.10
@storybook/react-vite 7.0.10

I also tried to use the sb command still did not work.

2

Answers


  1. Chosen as BEST ANSWER

    Finally I found the tutorial are the old version storybook config, the 7+ version of storybook are migrate from start-storybook to storybook dev: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#start-storybook--build-storybook-binaries-removed


  2. Here is the command applied for me to solve this issue based on migration document provided here:

    npx storybook@latest upgrade --prerelease
    

    Later yess to all (but always read if the solution provided by the CLI upgrade make sense for your current project/stack)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search