diff --git a/packages/core/src/npm.ts b/packages/core/src/npm.ts index 759e0487051f..4c4d21784aa4 100644 --- a/packages/core/src/npm.ts +++ b/packages/core/src/npm.ts @@ -103,7 +103,18 @@ export const layer = Layer.effect( add, dir: input.dir, }), - }) as Effect.Effect + }).pipe( + Effect.timeout("5 minutes"), + Effect.catchTag("TimeoutException", () => + Effect.fail( + new InstallFailedError({ + cause: new Error("npm install timed out after 5 minutes"), + add, + dir: input.dir, + }) + ) + ) + ) as Effect.Effect }).pipe( Effect.withSpan("Npm.reify", { attributes: input,