storybook: [Bug]: npx sb@next upgrade --prerelease fails

Describe the bug

On an existing SB repo, I tried to upgrade from RC to 7 by running the upgrade action. Here is the result:

*****@ip-***** ***** % npx sb@next upgrade --prerelease
Need to install the following packages:
  sb@7.0.0
Ok to proceed? (y) y
 • Checking for latest versions of '@storybook/*' packagesinfo ,Upgrading /Users/*****/*****/*****/package.json
info 
info All dependencies match the @next package versions :)
info ,npm WARN exec The following package was not found and will be installed: npm-check-updates@16.10.0
info npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
info 
info 
info ,Upgrading /Users/*****/*****/*****/package.json
info 
info No dependencies.
info ,
 • Installing upgrades • Preparing to install dependencies. ✓



> *****@0.0.0 postinstall
> ngcc --properties es2015 browser module main


> *****@0.0.0 prepare
> husky install

husky - Git hooks installed

removed 1 package, and audited 3845 packages in 12s

384 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (4 moderate, 1 high, 2 critical)

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
. ✓
🔎 checking possible migrations..

🔎 found a 'github-flavored-markdown-mdx' migration:
╭ Automigration detected ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                │
│   In MDX1 you had the option of using GitHub flavored markdown.                                                                                │
│                                                                                                                                                │
│   Storybook 7.0 uses MDX2 for compiling MDX, and thus no longer supports GFM out of the box.                                                   │
│   Because of this you need to explicitly add the GFM plugin in the addon-docs options:                                                         │
│   https://storybook.js.org/docs/7.0/react/writing-docs/mdx#lack-of-github-flavored-markdown-gfm                                                │
│                                                                                                                                                │
│   We recommend you follow the guide on the link above, however we can add a temporary storybook addon that helps make this migration easier.   │
│   We'll install the addon and add it to your storybook config.                                                                                 │
│                                                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✔ Do you want to run the 'github-flavored-markdown-mdx' migration on your project? … no
ERR! Error
ERR!     at NPMProxy.executeCommand (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:1665)
ERR!     at NPMProxy.findInstallations (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:2299)
ERR!     at automigrate (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:309:1066)
ERR!     at async doUpgrade (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:382:2893)
ERR!     at async withTelemetry (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/core-server/dist/index.js:27:3469)
ERR!     at async upgrade (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:382:3336)
ERR!  Error
ERR!     at NPMProxy.executeCommand (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:1665)
ERR!     at NPMProxy.findInstallations (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:2299)
ERR!     at automigrate (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:309:1066)
ERR!     at async doUpgrade (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:382:2893)
ERR!     at async withTelemetry (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/core-server/dist/index.js:27:3469)
ERR!     at async upgrade (/Users/*****/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:382:3336)

To Reproduce

No response

System

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 21 (7 by maintainers)

Most upvoted comments

Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.0 containing PR #21947 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

This still results in ELSPROBLEMS

image

+1 Also happening to me

✅ Adding "@storybook/addon-mdx-gfm" addon
✅ ran github-flavored-markdown-mdx migration
ERR! Error: npm ERR! code ELSPROBLEMS
ERR! npm ERR! invalid: @storybook/mdx1-csf@0.0.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/@storybook/mdx1-csf
ERR! npm ERR! invalid: cypress@12.8.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/cypress
ERR! npm ERR! invalid: glob@7.1.7 /Users/XXXXXXXXX/Documents/git/magma/packages/ui/node_modules/glob
ERR! npm ERR! missing: get-tsconfig@^4.2.0, required by eslint-import-resolver-typescript@3.5.3
ERR! npm ERR! missing: synckit@^0.8.4, required by eslint-import-resolver-typescript@3.5.3
ERR! npm ERR! invalid: acorn@7.4.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/acorn
ERR! npm ERR! invalid: react@18.2.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/react
ERR! npm ERR! invalid: @storybook/mdx2-csf@1.0.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/@storybook/mdx2-csf
ERR! npm ERR! invalid: webpack@5.76.2 /Users/XXXXXXXXX/Documents/git/magma/node_modules/webpack
ERR! npm ERR! invalid: react-dom@18.2.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/react-dom
ERR! npm ERR! missing: w3c-hr-time@^1.0.2, required by jsdom@19.0.0
ERR! npm ERR! missing: terminal-link@^2.0.0, required by @jest/reporters@28.1.3
ERR! {
ERR!   "error": {
ERR!     "code": "ELSPROBLEMS",
ERR!     "summary": "invalid: @storybook/mdx1-csf@0.0.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/@storybook/mdx1-csf\ninvalid: cypress@12.8.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/cypress\ninvalid: glob@7.1.7 /Users/XXXXXXXXX/Documents/git/magma/packages/ui/node_modules/glob\nmissing: get-tsconfig@^4.2.0, required by eslint-import-resolver-typescript@3.5.3\nmissing: synckit@^0.8.4, required by eslint-import-resolver-typescript@3.5.3\ninvalid: acorn@7.4.1 /Users/XXXXXXXXX/Documents/git/magma/node_modules/acorn\ninvalid: react@18.2.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/react\ninvalid: @storybook/mdx2-csf@1.0.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/@storybook/mdx2-csf\ninvalid: webpack@5.76.2 /Users/XXXXXXXXX/Documents/git/magma/node_modules/webpack\ninvalid: react-dom@18.2.0 /Users/XXXXXXXXX/Documents/git/magma/node_modules/react-dom\nmissing: w3c-hr-time@^1.0.2, required by jsdom@19.0.0\nmissing: terminal-link@^2.0.0, required by @jest/reporters@28.1.3",
ERR!     "detail": ""
ERR!   }
ERR! }
ERR! 
ERR!     at NPMProxy.executeCommand (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:1669)
ERR!     at NPMProxy.findInstallations (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:2303)
ERR!     at automigrate (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:317:1066)
ERR!     at async doUpgrade (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:2893)
ERR!     at async withTelemetry (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/core-server/dist/index.js:35:3422)
ERR!     at async upgrade (/Users/XXXXXXXXX/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:3336)

i face same issues with next.js 13

"devDependencies": {
    "@babel/core": "^7.21.4",
    "@storybook/addon-actions": "^7.0.1",
    "@storybook/addon-essentials": "^7.0.1",
    "@storybook/addon-interactions": "^7.0.1",
    "@storybook/addon-links": "^7.0.1",
    "@storybook/addon-mdx-gfm": "^7.0.1",
    "@storybook/nextjs": "^7.0.1",
    "@storybook/react": "^7.0.1",
    "@storybook/testing-library": "^0.1.0",
    "babel-loader": "^8.3.0",
    "eslint-plugin-storybook": "^0.6.11",
    "storybook": "^7.0.1"
 }

image

Same for me

Same error @carlosrsabreu, try running npx storybook@future upgrade --tag future

Yeah, it worked! 🚀 Thank you!

Same error @carlosrsabreu, try running npx storybook@future upgrade --tag future

Yay!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.2 containing PR #22039 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

Hello,

I run that command and I got this error:

ERR! Error
ERR!     at NPMProxy.executeCommand (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:1669)
ERR!     at NPMProxy.findInstallations (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:2371)
ERR!     at automigrate (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:317:1066)
ERR!     at async doUpgrade (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:2893)
ERR!     at async withTelemetry (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/core-server/dist/index.js:35:3422)
ERR!     at async upgrade (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:3336)
ERR!  Error
ERR!     at NPMProxy.executeCommand (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:1669)
ERR!     at NPMProxy.findInstallations (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:39:2371)
ERR!     at automigrate (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:317:1066)
ERR!     at async doUpgrade (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:2893)
ERR!     at async withTelemetry (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/core-server/dist/index.js:35:3422)
ERR!     at async upgrade (/Users/*******/.npm/_npx/eebb2d3a7d26a7f1/node_modules/@storybook/cli/dist/generate.js:390:3336)