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

Error with Storybook migration #28301

Closed
1 of 4 tasks
kuriangrge opened this issue Oct 4, 2024 · 2 comments · Fixed by #28605
Closed
1 of 4 tasks

Error with Storybook migration #28301

kuriangrge opened this issue Oct 4, 2024 · 2 comments · Fixed by #28605
Assignees
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug

Comments

@kuriangrge
Copy link

Current Behavior

During the migration of storybook to migrate-8, it gives the following error.

NX Calling sb upgrade

ℹ️ Nx will call the Storybook CLI to upgrade your @storybook/* packages to the latest version.
📖 You can read more about the Storybook upgrade command here: https://storybook.js.org/docs/react/configure/upgrading

yarn run v1.22.22
error Command "storybook@latest" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

NX Migration failed

Expected Behavior

The command for migration should continue smoothly.

npx nx g @nx/storybook:migrate-8

GitHub Repo

No response

Steps to Reproduce

  1. Open an existing projet with older version of story book.
  2. Execute npx nx g @nx/storybook:migrate-8
  3. Gives error.

Nx Report

NX Falling back to ts-node for local typescript execution. This may be a little slower.

  • To fix this, ensure @swc-node/register and @swc/core have been installed

NX Report complete - copy this into the issue template

Node : 21.2.0
OS : win32-x64
Native Target : x86_64-windows
yarn : 1.22.22

nx : 19.8.3
@nx/js : 19.8.3
@nx/jest : 19.8.3
@nx/linter : 19.8.3
@nx/eslint : 19.8.3
@nx/workspace : 19.8.3
@nx/cypress : 19.8.3
@nx/devkit : 19.8.3
@nx/eslint-plugin : 19.8.3
@nx/next : 19.8.3
@nx/react : 19.8.3
@nx/storybook : 19.8.3
@nrwl/tao : 19.8.3
@nx/vite : 19.8.3
@nx/web : 19.8.3
@nx/webpack : 19.8.3
typescript : 5.5.4

Community plugins:
@nxkit/playwright : 3.0.2

Failure Logs

PS C:\DevOn4\delaonline> npx nx g @nx/storybook:migrate-8

NX Generating @nx/storybook:migrate-8

NX Calling sb upgrade

ℹ️ Nx will call the Storybook CLI to upgrade your @storybook/* packages to the latest version.
📖 You can read more about the Storybook upgrade command here: https://storybook.js.org/docs/react/configure/upgrading

yarn run v1.22.22
error Command "storybook@latest" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

NX Migration failed

🚨 The Storybook CLI failed to upgrade your @storybook/* packages to the latest version.
Please try running the sb upgrade command manually:
yarn storybook@latest upgrade
Error: Command failed: yarn storybook@latest upgrade
at genericNodeError (node:internal/errors:956:15)
at wrappedFn (node:internal/errors:510:14)
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at callUpgrade (C:\DevOn4\delaonline\node_modules@nx\storybook\src\generators\migrate-8\calling-storybook-cli.js:18:38)
at migrate8Generator (C:\DevOn4\delaonline\node_modules@nx\storybook\src\generators\migrate-8\migrate-8.js:26:49)
at C:\DevOn4\delaonline\node_modules\nx\src\command-line\generate\generate.js:238:32
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async handleErrors (C:\DevOn4\delaonline\node_modules\nx\src\utils\handle-errors.js:9:24)
at async Object.handler (C:\DevOn4\delaonline\node_modules\nx\src\command-line\generate\command-object.js:14:22) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 34260,
stdout: null,
stderr: null
}
PS C:\DevOn4\delaonline> npx nx g @nx/storybook:migrate-8

NX Generating @nx/storybook:migrate-8

NX Calling sb upgrade

ℹ️ Nx will call the Storybook CLI to upgrade your @storybook/* packages to the latest version.
📖 You can read more about the Storybook upgrade command here: https://storybook.js.org/docs/react/configure/upgrading

yarn run v1.22.22
error Command "storybook@latest" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

NX Migration failed

🚨 The Storybook CLI failed to upgrade your @storybook/* packages to the latest version.
Please try running the sb upgrade command manually:
yarn storybook@latest upgrade
Error: Command failed: yarn storybook@latest upgrade
at genericNodeError (node:internal/errors:956:15)
at wrappedFn (node:internal/errors:510:14)
at checkExecSyncError (node:child_process:890:11)
at execSync (node:child_process:962:15)
at callUpgrade (C:\DevOn4\delaonline\node_modules@nx\storybook\src\generators\migrate-8\calling-storybook-cli.js:18:38)
at migrate8Generator (C:\DevOn4\delaonline\node_modules@nx\storybook\src\generators\migrate-8\migrate-8.js:26:49)
at C:\DevOn4\delaonline\node_modules\nx\src\command-line\generate\generate.js:238:32
at async handleErrors (C:\DevOn4\delaonline\node_modules\nx\src\utils\handle-errors.js:9:24)
at async Object.handler (C:\DevOn4\delaonline\node_modules\nx\src\command-line\generate\command-object.js:14:22) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 12364,
stdout: null,
stderr: null
}

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@jaysoo jaysoo added the scope: storybook Issues related to Storybook support in Nx label Oct 14, 2024
@xiongemi
Copy link
Collaborator

i think it is something with yarn. i tried with yarn 4, i got Usage Error: Couldn't find a script named "storybook@latest". when I run yarn storybook@latest upgrade. the command needs to change yarn storybook upgrade.

jaysoo pushed a commit that referenced this issue Oct 25, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #28301
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: storybook Issues related to Storybook support in Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants