From 78d5e0061fc7c3f5d8bb23913ce965845b72336c Mon Sep 17 00:00:00 2001 From: Shubham Kanodia Date: Sat, 2 Nov 2024 16:05:13 +0530 Subject: [PATCH] Fix cache dir for bun --- server/package/installation.utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/package/installation.utils.ts b/server/package/installation.utils.ts index abfeca1..dccbc70 100644 --- a/server/package/installation.utils.ts +++ b/server/package/installation.utils.ts @@ -135,13 +135,17 @@ const InstallationUtils = { command = `pnpm add ${packageStrings.join(" ")} --${flags.join(" --")}`; } else if (client === "bun") { + const cacheDir = path.join(tmpFolder, "cache") flags = [ "no-save", "exact", "no-progress", - `cache-dir ${path.join(tmpFolder, "cache")}`, + `cache-dir ${cacheDir}`, ]; + // Set the BUN_INSTALL_CACHE_DIR environment variable + // See https://github.com/oven-sh/bun/issues/6423 + process.env.BUN_INSTALL_CACHE_DIR = cacheDir; command = `bun install ${packageStrings.join(" ")} --${flags.join( " --", )}`;