diff --git a/packages/eas-cli/src/utils/expoUpdatesCli.ts b/packages/eas-cli/src/utils/expoUpdatesCli.ts index e50fed024f..f19a05ad01 100644 --- a/packages/eas-cli/src/utils/expoUpdatesCli.ts +++ b/packages/eas-cli/src/utils/expoUpdatesCli.ts @@ -26,8 +26,11 @@ export async function expoUpdatesCommandAsync(projectDir: string, args: string[] try { return (await spawnAsync(expoUpdatesCli, args)).stdout; } catch (e: any) { - if (e.stderr) { - if ((e.stderr as string).includes('Invalid command')) { + if (e.stderr && typeof e.stderr === 'string') { + if ( + e.stderr.includes('Invalid command') || // SDK 51+ + e.stderr.includes('commands[command] is not a function') // SDK <= 50 + ) { throw new ExpoUpdatesCLIInvalidCommandError( `The command specified by ${args} was not valid in the \`expo-updates\` CLI.` );