diff --git a/code/lib/core-server/src/utils/update-check.ts b/code/lib/core-server/src/utils/update-check.ts index f4c463d2e344..2012921921a0 100644 --- a/code/lib/core-server/src/utils/update-check.ts +++ b/code/lib/core-server/src/utils/update-check.ts @@ -37,8 +37,9 @@ export function createUpdateMessage(updateInfo: VersionCheck, version: string): let updateMessage; try { - const suffix = semver.prerelease(updateInfo.data.latest.version) ? '--prerelease' : ''; - const upgradeCommand = `npx storybook@latest upgrade ${suffix}`.trim(); + const isPrerelease = semver.prerelease(updateInfo.data.latest.version); + const suffix = isPrerelease ? '@next upgrade --prerelease' : '@latest upgrade'; + const upgradeCommand = `npx storybook${suffix}`; updateMessage = updateInfo.success && semver.lt(version, updateInfo.data.latest.version) ? dedent`