fix: increase build timeouts (120s→300s) and improve error messages

- npm install: 120s → 300s (cold cache can be slow)
- expo prebuild: 120s → 300s
- Better error reporting when steps fail
This commit is contained in:
Zebratic committed 2026-03-17 00:13:26 +00:00
1 parent d5ee698555
commit dcdb3069a8
1 file changed
+8 -2
+8 -2
View File
@@ -217,7 +217,13 @@ async function runBuild({ buildId, files, appName, packageName, version }) {
log(buildId, "info", "Installing dependencies (npm install --legacy-peer-deps)");
updateStatus(statusFile, "building", "Installing dependencies...", { progress: 20 });
execSync("npm install --legacy-peer-deps", { cwd: projectDir, stdio: "pipe", timeout: 120000 });
try {
execSync("npm install --legacy-peer-deps", { cwd: projectDir, stdio: "pipe", timeout: 300000 });
} catch (npmErr) {
const stderr = npmErr.stderr ? npmErr.stderr.toString().slice(-300) : "";
log(buildId, "error", "npm install failed", { stderr: stderr.slice(-200), message: npmErr.message });
throw new Error(`npm install failed: ${npmErr.message.includes("ETIMEDOUT") ? "Timed out after 5 minutes" : stderr || npmErr.message}`);
}
log(buildId, "info", "Dependencies installed successfully");
// Ensure app.json has android.package
@@ -253,7 +259,7 @@ async function runBuild({ buildId, files, appName, packageName, version }) {
execSync("npx expo prebuild --platform android --no-install", {
cwd: projectDir,
stdio: "pipe", maxBuffer: 50 * 1024 * 1024,
timeout: 120000,
timeout: 300000,
env: { ...process.env, CI: "1", EXPO_NO_TELEMETRY: "1" }
});
} catch (prebuildErr) {