From bac7f1679a16a62d9269216e7a29d00be8e02437 Mon Sep 17 00:00:00 2001 From: Sasan Tazayoni Date: Fri, 27 Feb 2026 12:14:24 +0000 Subject: [PATCH] fix(cli): use PowerShell Expand-Archive for zip extraction on Windows Windows built-in tar.exe (BSD tar) misinterprets the drive letter in a -C path (e.g. -C "C:\...") as a network hostname, causing extraction to fail with "tar: Cannot connect to C: resolve failed". On Windows, switch to PowerShell's Expand-Archive which handles Windows paths correctly. Non-Windows platforms continue to use tar as before. Co-Authored-By: Claude Sonnet 4.6 --- cli/scripts/postinstall.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/scripts/postinstall.js b/cli/scripts/postinstall.js index bdf9feb..5f785ab 100644 --- a/cli/scripts/postinstall.js +++ b/cli/scripts/postinstall.js @@ -86,7 +86,11 @@ async function downloadBinary(target) { } process.stdout.write(' Extracting... '); - execSync(`tar -xf "${archivePath}" -C "${tmpDir}"`, { stdio: 'pipe' }); + if (IS_WINDOWS) { + execSync(`powershell -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${tmpDir}' -Force"`, { stdio: 'pipe' }); + } else { + execSync(`tar -xf "${archivePath}" -C "${tmpDir}"`, { stdio: 'pipe' }); + } process.stdout.write('done\n'); const extracted = path.join(tmpDir, GATEWAY_BIN_NAME);