英文:
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)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论