Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer install Storybook with pnpm (invalid peer dependency) #16705

Closed
kaiyoma opened this issue Nov 16, 2021 · 2 comments
Closed

Can no longer install Storybook with pnpm (invalid peer dependency) #16705

kaiyoma opened this issue Nov 16, 2021 · 2 comments

Comments

@kaiyoma
Copy link

kaiyoma commented Nov 16, 2021

Describe the bug
Storybook no longer installs with pnpm due to an invalid peer dependency deep within the tree.

To Reproduce
Try to install 6.3.12 of @storybook/addon-docs with pnpm and you get this error:

 ERR_PNPM_INVALID_PEER_DEPENDENCY  ..\..\packages\cv-components > @storybook/addon-docs > @storybook/builder-webpack4 > terser-webpack-plugin: terser@5.10.0 requires a peer of acorn@^8.5.0 but version 7.4.1 was installed.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19043
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 14.18.1 - C:\Program Files\nodejs\node.EXE
    npm: 7.24.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 95.0.4638.69
    Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.53)

Additional context
You can see the problem in the package.json here: https://github.com/storybookjs/storybook/blob/v6.3.12/addons/docs/package.json

The version of acorn is not valid.

@kaiyoma
Copy link
Author

kaiyoma commented Nov 16, 2021

For anyone else hitting this, here's a .pnpmfile.cjs workaround:

function readPackage(packageJson, context) {
  // Workaround for https://github.com/storybookjs/storybook/issues/16705
  if (packageJson.name === "@storybook/addon-docs") {
    context.log("Fixing the acorn dependency for @storybook/addon-docs");
    packageJson.dependencies.acorn = "^8.5.0";
  }

  return packageJson;
}

@IanVS
Copy link
Member

IanVS commented Dec 30, 2022

pnpm support is vastly improved in Storybook 7.0. Can you give it a try with pnpx sb@next upgrade --prerelease and let us know if you're still having problems?

@IanVS IanVS closed this as completed Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants