sh: start-storybook: command not found in macOS

huangapple go评论54阅读模式
英文:

sh: start-storybook: command not found in macOS

问题

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

> ui-component@0.1.53 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.

英文:

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

> ui-component@0.1.53 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.

答案1

得分: 1

我找到了教程,这些教程是旧版本的storybook配置,storybook的7+版本已经从start-storybook迁移到了storybook dev:https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#start-storybook--build-storybook-binaries-removed

英文:

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

得分: 0

这是应用于我解决此问题的命令,基于提供的迁移文档这里

npx storybook@latest upgrade --prerelease

稍后选择是(但始终阅读,以确定CLI升级提供的解决方案是否适用于您的当前项目/堆栈)

英文:

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)

huangapple
  • 本文由 发表于 2023年5月11日 17:07:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76225918.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定