You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running pnpm dlx storybook@next upgrade in @storybook/addon-onboarding throws UpgradeStorybookToSameVersionError, although the project uses Storybook dependencies with the version 7.1.0-alpha.38. Everything works fine when using npx storybook@next upgrade.
This happens because we use require.resolve('@storybook/cli/package.json') to get the actual package path, and then check the version field in the package.json. However require.resolve in pnpx will get its own package and not the one in the actual working directory.
We need to change the logic to the package manager's CLI what version is installed in CWD (eg. pnpm why @storybook/cli), and then parse that output to determine the current version.
yarn dlx with Yarn 1 works, but 2+ has a similar issue where it can't detect the existing version so it just assumes v0.0.0
The text was updated successfully, but these errors were encountered:
Hah, I just noticed this as well when using pnpm dlx sb@latest upgrade in my project and came to see if there was already an issue about it. Thanks for filing it!
I also saw that npx is a bit wonky too, because it tells me:
Upgrading Storybook from version 0.0.0 to version 7.6.10.
@IanVS could you try with npx [email protected] upgrade from #25752 ? I've tested it with all the different executors and it works for me, but I haven't run into the issue using npx like you have, so you might have another setup that I'd like to see work too.
╭─────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Upgrading Storybook from version 7.6.0 to version 0.0.0-pr-25752-sha-424630b7.. │
│ This is a pre-release version. │
│ │
╰─────────────────────────────────────────────────────────────────────────────────────╯
Describe the bug
Running pnpm dlx storybook@next upgrade in @storybook/addon-onboarding throws
UpgradeStorybookToSameVersionError
, although the project uses Storybook dependencies with the version 7.1.0-alpha.38. Everything works fine when usingnpx storybook@next
upgrade.To Reproduce
npx storybook@latest sandbox
pnpm install
pnpx storybook@next upgrade
System
No response
Additional context
Originally posted by @valentinpalkovic in #25692 (comment)
This happens because we use
require.resolve('@storybook/cli/package.json')
to get the actual package path, and then check theversion
field in thepackage.json
. Howeverrequire.resolve
inpnpx
will get its own package and not the one in the actual working directory.We need to change the logic to the package manager's CLI what version is installed in CWD (eg.
pnpm why @storybook/cli
), and then parse that output to determine the current version.yarn dlx
with Yarn 1 works, but 2+ has a similar issue where it can't detect the existing version so it just assumes v0.0.0The text was updated successfully, but these errors were encountered: