storybook [Bug]:pnpm安装失败,GitHub Block中出现"Cannot read properties of null (reading 'matches')"错误,

cunj1qz1  于 2个月前  发布在  Git
关注(0)|答案(4)|浏览(36)

描述问题

你好!我正在尝试将storybook添加到一个repository with a GitHub Block项目中(我已经链接到了确切的提交,所以你可以在该提交处检出仓库并自己尝试)。我尝试了npx storybook initnpx 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`文件夹已经创建,但尚未对其他文件进行更改。
除了希望解决根本问题外:我找不到如何手动进行操作的教程?

重现步骤

  1. 克隆https://github.com/startup-cto/technical-debt-block/tree/61480d752b57a9d812cfea0186bab18291f9fa0e
  2. 运行npx storybook@latest init
tf7tbtn2

tf7tbtn21#

好的,如果我运行pnpx storybook@latest init而不是npx ...,它可以正常工作。我仍然认为这是一个bug,但不确定是否真的很重要。

dgtucam1

dgtucam12#

我们在7.0版本中显著提高了pnpm的支持,目前该版本处于RC阶段。您可以尝试一下吗?
您应该能够运行:

pnpx storybook@next init
utugiqy6

utugiqy63#

它与pnpx一起工作,但与npx不起作用。

j2datikz

j2datikz4#

尝试 pnpm dlx storybook@next init
对我有效

相关问题