ruvnet/ruflo · error · ExtractionError

Expand-Archive failed (exit ${result.exitCode}): ${result.st

Error message

Expand-Archive failed (exit ${result.exitCode}): ${result.stderr || result.stdout}

What it means

Error "Expand-Archive failed (exit ${result.exitCode}): ${result.stderr || result.stdout}" thrown in ruvnet/ruflo.

Source

Thrown at v3/@claude-flow/cli/src/proxy/install.ts:53

  if (result.exitCode !== 0) {
    throw new ExtractionError(`tar extraction failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);
  }
}

/**
 * Single-quoted literal paths (doubling any embedded single quote per
 * PowerShell string-literal escaping) passed as ONE argv element to
 * `-Command`. shell:false means no OS shell ever tokenizes this string —
 * only powershell.exe's own parser does.
 */
async function extractWithPowerShell(archivePath: string, extractDir: string): Promise<void> {
  const { SafeExecutor } = await import('@claude-flow/security');
  const escape = (p: string) => p.replace(/'/g, "''");
  const command = `Expand-Archive -LiteralPath '${escape(archivePath)}' -DestinationPath '${escape(extractDir)}' -Force`;
  const exec = new SafeExecutor({ allowedCommands: ['powershell', 'powershell.exe'], timeout: 60_000 });
  const result = await exec.execute('powershell', ['-NoProfile', '-NonInteractive', '-Command', command]);
  if (result.exitCode !== 0) {
    throw new ExtractionError(`Expand-Archive failed (exit ${result.exitCode}): ${result.stderr || result.stdout}`);
  }
}

/**
 * Extracts the archive via the OS's own tools — `tar` for `.tar.gz`
 * (present on macOS/Linux/Windows 10+), PowerShell `Expand-Archive`
 * specifically for `.zip` on Windows. Zero new archive-parsing dependency,
 * matching this repo's existing taste for shelling out over adding a parser dep.
 *
 * `Expand-Archive` stays the PRIMARY `.zip` path — bsdtar's zip support is
 * still not something to lean on by default. But `Microsoft.PowerShell.Archive`
 * is a *script* module resolved through PowerShell's module autoloading, so it
 * can fail for environment reasons entirely unrelated to the archive. Observed
 * in the wild on a healthy Windows 11 box, from ruflo's own `-NonInteractive`
 * child process:
 *
 *   Expand-Archive : The 'Expand-Archive' command was found in the module
 *   'Microsoft.PowerShell.Archive', but the module could not be loaded.

View on GitHub (pinned to 6b01dc5a68)

When it happens

Trigger: Thrown at v3/@claude-flow/cli/src/proxy/install.ts:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@6b01dc5a68 (2026-08-12). Data as JSON: /api/errors/7bcae8e663cc1fb0. Report an issue: GitHub.