iOfficeAI/OfficeCLI · error · Error

Could not download OfficeCLI binary (${asset} @ ${TAG}). Las

Error message

Could not download OfficeCLI binary (${asset} @ ${TAG}). Last error: ${lastErr && lastErr.message}. Install manually from ${GITHUB_BASE}/releases

What it means

Thrown by ensureBinary() after every download source (mirror primary, GitHub fallback) for the asset failed. lastErr holds the most recent failure. Unlike a checksum mismatch this means no usable bytes were ever obtained, so it directs the user to download manually from GitHub releases.

Source

Thrown at npm/lib/install-binary.js:239

  const asset = detectAsset();
  let lastErr = null;
  for (const url of assetUrls(asset)) {
    try {
      log('Downloading ' + asset + ' (' + TAG + ') from ' + url + ' ...');
      await fetchToFile(url, dest);
      await verifyChecksum(asset, dest);
      if (process.platform !== 'win32') {
        fs.chmodSync(dest, 0o755);
      }
      log('OfficeCLI ' + VERSION + ' installed.');
      return dest;
    } catch (e) {
      lastErr = e;
      try { fs.rmSync(dest, { force: true }); } catch (_) { /* ignore */ }
      log('  failed: ' + e.message);
    }
  }
  throw new Error(
    'Could not download OfficeCLI binary (' + asset + ' @ ' + TAG + '). ' +
    'Last error: ' + (lastErr && lastErr.message) +
    '. Install manually from ' + GITHUB_BASE + '/releases'
  );
}

module.exports = {
  ensureBinary: ensureBinary,
  binaryPath: binaryPath,
  detectAsset: detectAsset,
  VERSION: VERSION,
  TAG: TAG
};

View on GitHub (pinned to 1ced45e900)

Solutions

  1. Check connectivity to both sources: `curl -I https://d.officecli.ai/...` and the GitHub releases URL; read lastErr in the message for the exact cause.
  2. Set HTTPS_PROXY/HTTP_PROXY if you are behind a corporate proxy, or unset a broken proxy, then reinstall.
  3. Confirm the pinned TAG exists and has the asset: open https://github.com/iOfficeAI/OfficeCLI/releases/tag/<TAG>.
  4. Download the asset manually from GitHub releases, verify its SHA-256 against SHA256SUMS, and drop it into node_modules/@officecli/officecli/vendor/<binaryName> (chmod 0755 on Unix).

Example fix

// before: Could not download OfficeCLI binary (... @ v1.0.122). Last error: connect ETIMEDOUT
// after: configure egress/proxy and retry, or place the binary manually
HTTPS_PROXY=http://corporate-proxy:8080 npm install
# manual fallback:
curl -fsSL https://github.com/iOfficeAI/OfficeCLI/releases/download/<TAG>/officecli-linux-x64 -o node_modules/@officecli/officecli/vendor/officecli
chmod 0755 node_modules/@officecli/officecli/vendor/officecli
Defensive patterns

Strategy: fallback

Validate before calling

// Probe egress to both download sources before relying on postinstall
const https = require('https');
function reachable(url) { return new Promise(r => { const t = setTimeout(()=>r(false),5000); https.get(url, res=>{clearTimeout(t); r(res.statusCode===200 || res.statusCode<400); }).on('error',()=>r(false)); }); }
const ok = await reachable('https://d.officecli.ai/install.sh') && await reachable('https://github.com/iOfficeAI/OfficeCLI/releases');

Prevention

When it happens

Trigger: No network egress to d.officecli.ai and github.com; a restrictive firewall/proxy blocks both; both sources return non-2xx (wrong TAG, unpublished release, 404/403 rate-limit); DNS failure; the release for the pinned TAG has not been uploaded yet.

Common situations: Air-gapped or corporate-locked CI; GitHub rate-limiting raw downloads; a freshly published npm package whose GitHub release artifacts lag behind; mistagged VERSION in package.json pointing at a non-existent release.

Related errors


AI-assisted analysis of iOfficeAI/OfficeCLI@1ced45e900 (2026-08-13). Data as JSON: /api/errors/107654fb4ff48409. Report an issue: GitHub.