Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🐛 Bug fixes

- [eas-cli] Check that `expo` is resolvable before assuming it's installed ([#3748](https://github.com/expo/eas-cli/pull/3748) by [@kitten](https://github.com/kitten))

### 🧹 Chores

## [18.13.1](https://github.com/expo/eas-cli/releases/tag/v18.13.1) - 2026-05-18
Expand Down
19 changes: 17 additions & 2 deletions packages/eas-cli/src/project/projectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGr
import { AccountFragment } from '../graphql/generated';
import { AppQuery } from '../graphql/queries/AppQuery';
import Log, { learnMore } from '../log';
import { expoCommandAsync } from '../utils/expoCli';
import { expoCommandAsync, resolveExpoCli } from '../utils/expoCli';

/**
* Return a useful name describing the project config.
Expand Down Expand Up @@ -45,7 +45,22 @@ export function isExpoNotificationsInstalled(projectDir: string): boolean {

export function isExpoInstalled(projectDir: string): boolean {
const packageJson = getPackageJson(projectDir);
return !!(packageJson.dependencies && 'expo' in packageJson.dependencies);
if (!!(packageJson.dependencies && 'expo' in packageJson.dependencies)) {
// NOTE(@kitten): We usually don't apply strict checks for installed packages, but
// `isExpoInstalled` is often used to check if we should call the Expo CLI, so we're
// also checking if we can resolve `expo` here
try {
return !!resolveExpoCli(projectDir);
} catch (e: any) {
if (e.code === 'MODULE_NOT_FOUND') {
return false;
} else {
throw e;
}
}
} else {
return false;
}
}

export function isExpoUpdatesInstalledAsDevDependency(projectDir: string): boolean {
Expand Down
9 changes: 7 additions & 2 deletions packages/eas-cli/src/utils/expoCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,20 @@ export const shouldUseVersionedExpoCLIWithExplicitPlatforms = memoize(
shouldUseVersionedExpoCLIWithExplicitPlatformsExpensive
);

export function resolveExpoCli(projectDir: string): string {
return (
silentResolveFrom(projectDir, 'expo/bin/cli') ?? resolveFrom(projectDir, 'expo/bin/cli.js')
);
}

export function spawnExpoCommand(
projectDir: string,
args: string[],
opts?: CommonSpawnOptions
): spawnAsync.SpawnPromise<spawnAsync.SpawnResult> {
let expoCliPath;
try {
expoCliPath =
silentResolveFrom(projectDir, 'expo/bin/cli') ?? resolveFrom(projectDir, 'expo/bin/cli.js');
expoCliPath = resolveExpoCli(projectDir);
} catch (e: any) {
if (e.code === 'MODULE_NOT_FOUND') {
throw new Error(
Expand Down
Loading