storybook: sh: start-storybook: command not found after upgrading to latest release

Describe the bug I upgraded our version of Storybook in our React project to the latest version ^6.5 Afterwards I have the following issue when trying to run Storybook - sh: start-storybook: command not found Using a Macbook.

Then upgraded to pre-release to see if it resolved.

To Reproduce Upgrade Storybook and try to run it.

System Environment Info:

System: OS: macOS 12.1 CPU: (10) arm64 Apple M1 Pro Binaries: Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node npm: 8.17.0 - ~/Desktop/customer_contact_work/cc-component-library/node_modules/.bin/npm Browsers: Chrome: 104.0.5112.79 Safari: 15.2 npmPackages: @storybook/addon-actions: ^7.0.0-alpha.18 => 7.0.0-alpha.19 @storybook/addon-essentials: ^7.0.0-alpha.18 => 7.0.0-alpha.19 @storybook/addon-links: ^7.0.0-alpha.18 => 7.0.0-alpha.19 @storybook/builder-webpack5: ^7.0.0-alpha.18 => 7.0.0-alpha.19 @storybook/cli: ^6.5.10 => 6.5.10 @storybook/manager-webpack5: ^7.0.0-alpha.10 => 7.0.0-alpha.10 @storybook/react: ^7.0.0-alpha.18 => 7.0.0-alpha.19 Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (2 by maintainers)

Most upvoted comments

I had this issue too, and discovered in the v7 release notes that start-storybook and build-storybook were removed. Here’s the PR and a similar discussion here: https://github.com/storybookjs/storybook/issues/18675

I had to install @storybook/cli (make sure the version is the same as the Storybook core you are using, e.g. 7.0.0-alpha.19 based on your listed env info) and then sb dev worked!

If you have upgraded to storybook 7 and found yourself here then the problem is start-storybook is removed and the migration doesn’t modify for some reason.

To fix modify your scripts to;

"storybook": "sb dev",
"build-storybook": "sb build"

Also check out the migration guide - https://github.com/storybookjs/storybook/blob/4a532ec8d8922ddf6b7a7e1cc68d88b35377b0a6/MIGRATION.md#start-storybook--build-storybook-binaries-removed

I was missing some things

Run npx storybook@next automigrate and follow the prompts because youre using a newer version of storybook where start storybook and build storybook have been removed

This sorted me out. caveat: I did blindly accept all the changes

npx sb@next automigrate

I met this same issue and now I figured it out what happens. If you upgrade to storybook@7 via command:

npx storybook@7 upgrade

The auto migration will handle this: image image The migration will install storybook (Looks like it is actually same as @storybook/cli just have better name?) which includes binary storybook and sb. The migration will also help to auto update the npm scripts in packages.json So if in some case you have skipped that step (maybe you upgrade storybook via just upgrading storybook related packages), then just manually install npm i storybook -D or yarn add storybook -D and update the npm scripts from:

    "storybook": "start-storybook -p 6006",
    "buildStorybook": "build-storybook",

to:

    "storybook": "storybook dev -p 6006",
    "buildStorybook": "storybook build",

Thanks @Abeinevincent, It works well.

@zackhamin check out this https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#story-type-change-to-storyfn-and-the-new-story-type-now-refers-to-storyobj

I think you need to go from

export const MyStory: Story = () => <div />;

to

export const MyStory: StoryFn = () => <div />;

note the StoryFn