storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.95k stars 9.22k forks source link

[Bug]: PNPM Install returning errors #28696

Closed madeinjei closed 2 weeks ago

madeinjei commented 1 month ago

Describe the bug

Whenever I use PNPM to install storybook for nextjs it will install storybook successfully but then return errors when installing whatever packages it needs for the nextjs compatibility

Reproduction link

NONE

Reproduction steps

run pnpm dlx storybook@latest init in your nextjs project environment

System

Storybook Environment Info:

  System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M2 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - /usr/local/bin/node
    pnpm: 9.6.0 - /usr/local/bin/pnpm <----- active
  Browsers:
    Safari: 17.5
  npmPackages:
    @storybook/addon-essentials: ^8.2.5 => 8.2.5 
    @storybook/addon-interactions: ^8.2.5 => 8.2.5 
    @storybook/addon-links: ^8.2.5 => 8.2.5 
    @storybook/addon-onboarding: ^8.2.5 => 8.2.5 
    @storybook/blocks: ^8.2.5 => 8.2.5 
    @storybook/nextjs: ^8.2.5 => 8.2.5 
    @storybook/react: ^8.2.5 => 8.2.5 
    @storybook/test: ^8.2.5 => 8.2.5

Additional context

No response

greptile-apps[bot] commented 1 month ago

Disclaimer This information might be inaccurate, due to it being generated automatically To resolve the PNPM install errors when setting up Storybook for Next.js, follow these steps:

  1. Ensure you are using the latest version of Storybook by running:

    pnpm dlx storybook@latest init
  2. If you encounter errors, manually add the required Storybook packages for Next.js:

    pnpm add --save-dev @storybook/nextjs @storybook/addon-essentials @storybook/addon-interactions @storybook/addon-links @storybook/addon-onboarding @storybook/blocks @storybook/react @storybook/test
  3. Verify your package.json includes the necessary dependencies and scripts for Storybook.

  4. If issues persist, run the Storybook doctor command to diagnose problems:

    pnpm dlx storybook@latest doctor

Refer to the initiate.ts file for more details on the initialization process.

References

/code/lib/cli/src/initiate.ts /code/lib/cli/src/automigrate/index.test.ts /docs/_snippets/storybook-addon-compiler-babel-auto-install.md /docs/_snippets/storybook-addon-essentials-install.md /code/core/src/server-errors.ts /docs/_snippets/storybook-addon-compiler-swc-auto-install.md /docs/_snippets/storybook-init-v7.md /code/lib/cli/src/upgrade.test.ts /docs/_snippets/nextjs-install.md /docs/_snippets/storybook-doctor.md /code/lib/cli/src/automigrate/fixes/missing-storybook-dependencies.ts /docs/_snippets/react-webpack5-install.md /code/core/src/common/js-package-manager/PNPMProxy.ts /code/lib/cli/src/helpers.test.ts /docs/_snippets/test-runner-execute.md /docs/_snippets/test-runner-execute-with-url.md /code/lib/cli/src/automigrate/fixes/sb-scripts.test.ts /code/lib/cli/src/automigrate/fixes/prompt-remove-react.ts /docs/_snippets/init-command-manual-framework.md /docs/_snippets/storybook-telemetry-storybook-enable-crash-reports.md /docs/_snippets/web-components-webpack5-install.md /docs/_snippets/test-runner-execute-with-flags.md /code/lib/cli/src/automigrate/fixes/sb-binary.test.ts /docs/get-started/install.mdx /docs/_snippets/storybook-a11y-install.md

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/storybookjs/storybook/next) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)
shilman commented 1 month ago

I couldn't reproduce with a fresh next app.

Do you a have a reproduction repo you can share? If not, can you create one? Go to https://storybook.new or see repro docs. Thank you! ๐Ÿ™

madeinjei commented 1 month ago

I don't have a repo, but I also tried it on a blank project and I got the same error( and when I say blank I mean I just initialized node and only installed storybook

github-actions[bot] commented 3 weeks ago

Hi there! Thank you for opening this issue, but it has been marked as stale because we need more information to move forward. Could you please provide us with the requested reproduction or additional information that could help us better understand the problem? We'd love to resolve this issue, but we can't do it without your help!

github-actions[bot] commented 2 weeks ago

I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists โ€“ we're always happy to help. Thanks so much for your understanding.