diff --git a/code/lib/cli/src/doctor/index.ts b/code/lib/cli/src/doctor/index.ts index 6aab5507b21a..0e2f0747aa7a 100644 --- a/code/lib/cli/src/doctor/index.ts +++ b/code/lib/cli/src/doctor/index.ts @@ -105,6 +105,15 @@ export const doctor = async ({ const allDependencies = (await packageManager.getAllDependencies()) as Record; + 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, });