File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
code/lib/cli-storybook/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
22import { mkdir , readdir , rm } from 'node:fs/promises' ;
33import { isAbsolute } from 'node:path' ;
44
5- import type { PackageManagerName } from 'storybook/internal/common' ;
5+ import { PackageManagerName } from 'storybook/internal/common' ;
66import {
77 JsPackageManagerFactory ,
88 isCI ,
@@ -42,10 +42,10 @@ export const sandbox = async ({
4242 let selectedConfig : Template | undefined = TEMPLATES [ filterValue as TemplateKey ] ;
4343 let templateId : Choice | null = selectedConfig ? ( filterValue as TemplateKey ) : null ;
4444
45- const { packageManager : pkgMgr } = options ;
46-
45+ // Always use npm to fetch versions, as other package manager commands may fail when running in
46+ // non-project directories (e.g. parent sandbox directory). We just need to use npm info for this use case.
4747 const packageManager = JsPackageManagerFactory . getPackageManager ( {
48- force : pkgMgr ,
48+ force : PackageManagerName . NPM ,
4949 } ) ;
5050 const latestVersion = ( await packageManager . latestVersion ( 'storybook' ) ) ! ;
5151 const nextVersion = ( await packageManager . latestVersion ( 'storybook@next' ) ) ?? '0.0.0' ;
You can’t perform that action at this time.
0 commit comments