Skip to content

Commit

Permalink
Merge pull request #28604 from storybookjs/kasper/storybook-doctor-error
Browse files Browse the repository at this point in the history
CLI: Add diagnostic when the `storybook` package is missing
  • Loading branch information
kasperpeulen committed Jul 15, 2024
2 parents 12afaac + 3fb7d91 commit cbfe209
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/lib/cli/src/doctor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ export const doctor = async ({

const allDependencies = (await packageManager.getAllDependencies()) as Record<string, string>;

if (!('storybook' in allDependencies)) {
logDiagnostic(
`Package ${chalk.cyan('storybook')} not found`,
dedent`
The ${chalk.cyan('storybook')} package was not found in your package.json.
Installing ${chalk.cyan('storybook')} as a direct dev dependency in your package.json is required.
`
);
}
const incompatibleStorybookPackagesList = await getIncompatibleStorybookPackages({
currentStorybookVersion: storybookVersion,
});
Expand Down

0 comments on commit cbfe209

Please sign in to comment.