Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
refactor(expo-cli): add npm install fallback to yarn install
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Dec 22, 2023
1 parent 4c9dd7f commit f467b21
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/expo-cli/e2e/TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,19 @@ export async function createMinimalProjectAsync(

fs.writeFileSync(path.join(projectRoot, 'App.js'), getBasicAppJs());

// TODO(Bacon): We shouldn't need this
// Install the packages so eject can infer the versions
spawnAsync('yarn', [], {
cwd: projectRoot,
stdio: process.env.CI === 'true' ? 'inherit' : ['ignore', 'inherit', 'inherit'],
});
try {
// TODO(Bacon): We shouldn't need this
// Install the packages so eject can infer the versions
await spawnAsync('yarn', [], {
cwd: projectRoot,
stdio: process.env.CI === 'true' ? 'inherit' : ['ignore', 'inherit', 'inherit'],
});
} catch {
await spawnAsync('npm', ['install'], {
cwd: projectRoot,
stdio: process.env.CI === 'true' ? 'inherit' : ['ignore', 'inherit', 'inherit'],
});
}

return projectRoot;
}

0 comments on commit f467b21

Please sign in to comment.