
























@@ -302,6 +302,20 @@ function resolveServiceRefreshEnv(
302302return resolvedEnv;
303303}
304304305+function disableUpdatedPackageCompileCacheEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
306+return {
307+ ...env,
308+NODE_DISABLE_COMPILE_CACHE: "1",
309+};
310+}
311+312+function resolveUpdatedInstallCommandEnv(
313+env: NodeJS.ProcessEnv,
314+invocationCwd?: string,
315+): NodeJS.ProcessEnv {
316+return disableUpdatedPackageCompileCacheEnv(resolveServiceRefreshEnv(env, invocationCwd));
317+}
318+305319type UpdateDryRunPreview = {
306320dryRun: true;
307321root: string;
@@ -376,7 +390,7 @@ async function refreshGatewayServiceEnv(params: {
376390if (entrypoint) {
377391const res = await runCommandWithTimeout([resolveNodeRunner(), entrypoint, ...args], {
378392cwd: params.result.root,
379-env: resolveServiceRefreshEnv(params.env ?? process.env, params.invocationCwd),
393+env: resolveUpdatedInstallCommandEnv(params.env ?? process.env, params.invocationCwd),
380394timeoutMs: SERVICE_REFRESH_TIMEOUT_MS,
381395});
382396if (res.code === 0) {
@@ -415,7 +429,7 @@ async function runUpdatedInstallGatewayRestart(params: {
415429}
416430const res = await runCommandWithTimeout([resolveNodeRunner(), entrypoint, ...args], {
417431cwd: params.result.root,
418-env: resolveServiceRefreshEnv(params.env ?? process.env, params.invocationCwd),
432+env: resolveUpdatedInstallCommandEnv(params.env ?? process.env, params.invocationCwd),
419433timeoutMs: SERVICE_REFRESH_TIMEOUT_MS,
420434});
421435if (res.code === 0) {
@@ -553,7 +567,7 @@ async function runPackageInstallUpdate(params: {
553567name: `${CLI_NAME} doctor`,
554568argv: [resolveNodeRunner(), entryPath, "doctor", "--non-interactive", "--fix"],
555569env: {
556- ...process.env,
570+ ...disableUpdatedPackageCompileCacheEnv(process.env),
557571OPENCLAW_UPDATE_IN_PROGRESS: "1",
558572},
559573timeoutMs: params.timeoutMs,
@@ -1140,7 +1154,7 @@ async function continuePostCoreUpdateInFreshProcess(params: {
11401154const child = spawn(resolveNodeRunner(), argv, {
11411155stdio: "inherit",
11421156env: {
1143- ...process.env,
1157+ ...disableUpdatedPackageCompileCacheEnv(process.env),
11441158[POST_CORE_UPDATE_ENV]: "1",
11451159[POST_CORE_UPDATE_CHANNEL_ENV]: params.channel,
11461160 ...(resultPath ? { [POST_CORE_UPDATE_RESULT_PATH_ENV]: resultPath } : {}),
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。