diff --git a/lib/cli/src/upgrade.ts b/lib/cli/src/upgrade.ts index 47992a7daaf..b82c90e102e 100644 --- a/lib/cli/src/upgrade.ts +++ b/lib/cli/src/upgrade.ts @@ -99,7 +99,8 @@ export const upgrade = async ({ prerelease, skipCheck, useNpm, dryRun }: Options const flags = []; if (!dryRun) flags.push('--upgrade'); - if (prerelease) flags.push('--newest'); + flags.push('--target'); + flags.push(prerelease ? 'greatest' : 'latest'); const check = spawnSync('npx', ['npm-check-updates', '/storybook/', ...flags], { stdio: 'pipe', }).output.toString();