描述问题
你好!我正在尝试将storybook添加到一个repository with a GitHub Block项目中(我已经链接到了确切的提交,所以你可以在该提交处检出仓库并自己尝试)。我尝试了npx storybook init
和npx storybook@next init
,它们都会出现以下错误信息:
storybook init - the simplest way to add a Storybook to your project.
• Detecting project type. ✓
• Adding Storybook support to your "React" app
attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[https://storybook.js.org/telemetry](https://storybook.js.org/telemetry)
npm ERR! Cannot read properties of null (reading 'matches')
Both `.storybooks`和`stories`文件夹已经创建,但尚未对其他文件进行更改。
除了希望解决根本问题外:我找不到如何手动进行操作的教程?
重现步骤
- 克隆
https://github.com/startup-cto/technical-debt-block/tree/61480d752b57a9d812cfea0186bab18291f9fa0e
- 运行
npx storybook@latest init
4条答案
按热度按时间tf7tbtn21#
好的,如果我运行
pnpx storybook@latest init
而不是npx ...
,它可以正常工作。我仍然认为这是一个bug,但不确定是否真的很重要。dgtucam12#
我们在7.0版本中显著提高了
pnpm
的支持,目前该版本处于RC阶段。您可以尝试一下吗?您应该能够运行:
utugiqy63#
它与
pnpx
一起工作,但与npx
不起作用。j2datikz4#
尝试
pnpm dlx storybook@next init
对我有效