storybookjs / storybook

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

[Bug]: Can not install @storybook/node-logger on yarn v3,v4 #26932

Closed legobeat closed 6 months ago

legobeat commented 6 months ago

Describe the bug

On a storybook v7 project using yarn v4 as package manager, yarn install fails as of recently:

$ yarn
➤ YN0000: · Yarn 4.0.2
➤ YN0000: ┌ Resolution step
➤ YN0001: │ Error: @storybook/node-logger@workspace:*: Workspace not found (@storybook/node-logger@workspace:*)
    at St.getWorkspaceByDescriptor (foo/.yarn/releases/yarn-4.0.2.cjs:210:3520)
    at a1.getCandidates (foo/.yarn/releases/yarn-4.0.2.cjs:140:115280)
    at vd.getCandidates (foo/.yarn/releases/yarn-4.0.2.cjs:141:1311)
    at vd.getCandidates (foo/.yarn/releases/yarn-4.0.2.cjs:141:1311)
    at metamask/.yarn/releases/yarn-4.0.2.cjs:210:8409
    at Wy (foo/.yarn/releases/yarn-4.0.2.cjs:140:53920)
    at ke (foo/.yarn/releases/yarn-4.0.2.cjs:210:8389)
    at async Promise.allSettled (index 0)
    at async Uc (foo/.yarn/releases/yarn-4.0.2.cjs:140:53248)
➤ YN0000: └ Completed in 13s 985ms
➤ YN0000: · Failed with errors in 14s 32ms

To Reproduce

System

Storybook Environment Info:

  System:
    OS: Linux
    Shell: /bin/zsh
  Binaries:
    Node: 20.12.2 - /tmp/xfs-e21e3064/node
    Yarn: 4.0.2 - /tmp/xfs-e21e3064/yarn <----- active
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
  npmPackages:
    @storybook/addon-a11y: ^7.6.17 => 7.4.6
    @storybook/addon-actions: ^7.6.17 => 7.4.6
    @storybook/addon-designs: ^7.0.9 => 7.0.5
    @storybook/addon-docs: ^7.6.17 => 7.5.3
    @storybook/addon-essentials: ^7.6.17 => 7.4.6
    @storybook/addon-knobs: ^7.0.2 => 7.0.2
    @storybook/addon-mdx-gfm: ^7.6.17 => 7.4.6
    @storybook/addons: ^7.6.17 => 7.4.6
    @storybook/api: ^7.6.17 => 7.4.6
    @storybook/client-api: ^7.6.17 => 7.4.6
    @storybook/components: ^7.6.17 => 7.5.3
    @storybook/core-events: ^7.6.17 => 7.5.3
    @storybook/react: ^7.6.17 => 7.4.6
    @storybook/react-webpack5: ^7.6.17 => 7.4.6
    @storybook/storybook-deployer: ^2.8.16 => 2.8.16
    @storybook/test-runner: ^0.16.0 => 0.14.1
    @storybook/theming: ^7.6.17 => 7.5.3
    eslint-plugin-storybook: ^0.6.15 => 0.6.15
    storybook: ^7.6.17 => 7.4.6
    storybook-dark-mode: ^3.0.3 => 3.0.1

Additional context

lsarni commented 6 months ago

Same on yarn 3.6.3

YN0001: │ Error: @storybook/node-logger@workspace:*: Workspace not found (@storybook/node-logger@workspace:*)
    at je.getWorkspaceByDescriptor (/foo/.yarn/releases/yarn-3.6.3.cjs:439:3260)
    at cC.getCandidates (/foo/.yarn/releases/yarn-3.6.3.cjs:390:29582)
    at kf.getCandidates (/foo/.yarn/releases/yarn-3.6.3.cjs:391:1264)
    at kf.getCandidates (/foo/.yarn/releases/yarn-3.6.3.cjs:391:1264)
    at /foo/.yarn/releases/yarn-3.6.3.cjs:439:8033
    at df (/foo/.yarn/releases/yarn-3.6.3.cjs:390:11070)
    at ge (/foo/.yarn/releases/yarn-3.6.3.cjs:439:8013)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.allSettled (index 0)
    at async io (/foo/.yarn/releases/yarn-3.6.3.cjs:390:10398)
paulfermoreyes commented 6 months ago

We also encountered this just today even though we didn't have any changes in our dependencies. Our workaround is to add a resolution to an older version Yarn install ran successfully after this and we still don't know the root cause...

package.json


{
  "resolutions": {
    "@storybook/node-logger": "7.6.16"
  }
}
antonbehaeghe commented 6 months ago

Looks like they accidentally committed pnpm config on @storybook/addon-mdx-gfm


"dependencies": {
    "@storybook/node-logger": "workspace:*",
    "remark-gfm": "^4.0.0",
    "ts-dedent": "^2.0.0"
  },
cw-natejohnson commented 6 months ago

I upgraded from "@storybook/addon-mdx-gfm": "^7.6.17", to "@storybook/addon-mdx-gfm": "^8.0.9", to resolve the issue.

miladpav commented 6 months ago

Try this if you want stay on your version

yarn add @storybook/addon-mdx-gfm@7.6.16 --verbose && yarn install --verbose

https://github.com/storybookjs/storybook/issues/26929#issuecomment-2088820360

cw-natejohnson commented 6 months ago

Pinning the version to 7.6.16 works too. Thanks, @miladpav.

shilman commented 6 months ago

This is a bad release and we are looking into a fix now. Please pin your version to 7.6.16 as a temporary workaround. Sorry for the inconvenience!

JReinhold commented 6 months ago

This should be fixed now in version 7.6.19. https://github.com/storybookjs/storybook/releases/tag/v7.6.19

Run npx storybook@7.6.19 upgrade to upgrade.