diff --git a/web-nodejs/services/updateService.js b/web-nodejs/services/updateService.js index 38909995..5a5e8205 100644 --- a/web-nodejs/services/updateService.js +++ b/web-nodejs/services/updateService.js @@ -764,6 +764,9 @@ function buildEnvWithGo(goBinPath) { const { modCache, buildCache } = ensureGoCacheDirs(); env.GOMODCACHE = modCache; env.GOCACHE = buildCache; + // betterdesk user's HOME is often /var/lib/betterdesk (root-owned). + // Go also writes toolchain/sumdb state under $HOME/go — redirect HOME. + env.HOME = config.dataDir; } catch (err) { console.warn(`[UPDATE] Could not prepare Go cache dirs: ${err.message}`); }