fix(windows): handle undefined environment variables in runCommandWithTimeout

This commit is contained in:
Burak Sormageç
2026-01-30 16:17:36 +00:00
committed by Peter Steinberger
parent d7fb01afad
commit e97aa45428

View File

@@ -100,7 +100,11 @@ export async function runCommandWithTimeout(
return false;
})();
const resolvedEnv = env ? { ...process.env, ...env } : { ...process.env };
const resolvedEnv = Object.fromEntries(
Object.entries({ ...process.env, ...(env ?? {}) })
.filter(([, value]) => value !== undefined)
.map(([key, value]) => [key, String(value)]),
);
if (shouldSuppressNpmFund) {
if (resolvedEnv.NPM_CONFIG_FUND == null) {
resolvedEnv.NPM_CONFIG_FUND = "false";