File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -366,7 +366,14 @@ const resolvers = {
366366 const { stdout } = await execAsync ( 'bun pm bin -g' ) ;
367367 binDir = stdout . trim ( ) ;
368368 } catch ( error ) {
369- throw new Error ( 'Bun is not installed or not available in PATH.' , { cause : error } ) ;
369+ // In CI or fresh environments, the global directory might not exist
370+ // Try to get the default Bun install path
371+ const home = process . env . HOME || process . env . USERPROFILE ;
372+ if ( home ) {
373+ binDir = path . join ( home , '.bun' , 'bin' ) ;
374+ } else {
375+ throw new Error ( 'Unable to determine Bun global directory.' , { cause : error } ) ;
376+ }
370377 }
371378
372379 const bunInstallRoot = path . resolve ( binDir , '..' ) ;
Original file line number Diff line number Diff line change @@ -411,7 +411,14 @@ export const resolvers = {
411411 const { stdout } = await execAsync ( 'bun pm bin -g' ) ;
412412 binDir = stdout . trim ( ) ;
413413 } catch ( error ) {
414- throw new Error ( 'Bun is not installed or not available in PATH.' , { cause : error } ) ;
414+ // In CI or fresh environments, the global directory might not exist
415+ // Try to get the default Bun install path
416+ const home = process . env . HOME || process . env . USERPROFILE ;
417+ if ( home ) {
418+ binDir = path . join ( home , '.bun' , 'bin' ) ;
419+ } else {
420+ throw new Error ( 'Unable to determine Bun global directory.' , { cause : error } ) ;
421+ }
415422 }
416423
417424 const bunInstallRoot = path . resolve ( binDir , '..' ) ;
You can’t perform that action at this time.
0 commit comments