fix(bun-install): forward process.env so child bun install inherits proxy settings (fixes #3528)
Root cause: runBunInstallWithDetails() invoked spawnWithWindowsHide() without passing env, so the child bun install lost https_proxy / http_proxy / NO_PROXY and other parent env vars. @npmcli/agent then received an empty proxy URL and rejected fetch with 'fetch() proxy.url must be a non-empty string', breaking plugin auto-install on networks that require an outbound proxy. Fix: pass env: process.env to spawnWithWindowsHide so the child bun install inherits the full parent environment, including proxy variables. Verification: added a regression test that sets https_proxy/http_proxy on process.env and asserts those values are forwarded to the spawn options. Test fails before the fix and passes after. typecheck clean. Other pre-existing path-separator test failures on Windows are unrelated to this change.
This commit is contained in:
@@ -85,6 +85,7 @@ export async function runBunInstallWithDetails(options?: RunBunInstallOptions):
|
||||
try {
|
||||
const proc = spawnWithWindowsHide(["bun", "install"], {
|
||||
cwd: cacheDir,
|
||||
env: process.env,
|
||||
stdout: outputMode,
|
||||
stderr: outputMode,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user