{"record":{"id":"107654fb4ff48409","repo":"iOfficeAI/OfficeCLI","slug":"could-not-download-officecli-binary-asset","errorCode":null,"errorMessage":"Could not download OfficeCLI binary (${asset} @ ${TAG}). Last error: ${lastErr && lastErr.message}. Install manually from ${GITHUB_BASE}/releases","messagePattern":"Could not download OfficeCLI binary \\((.+?) @ (.+?)\\)\\. Last error: (.+?)\\. Install manually from (.+?)/releases","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/lib/install-binary.js","lineNumber":239,"sourceCode":"  const asset = detectAsset();\n  let lastErr = null;\n  for (const url of assetUrls(asset)) {\n    try {\n      log('Downloading ' + asset + ' (' + TAG + ') from ' + url + ' ...');\n      await fetchToFile(url, dest);\n      await verifyChecksum(asset, dest);\n      if (process.platform !== 'win32') {\n        fs.chmodSync(dest, 0o755);\n      }\n      log('OfficeCLI ' + VERSION + ' installed.');\n      return dest;\n    } catch (e) {\n      lastErr = e;\n      try { fs.rmSync(dest, { force: true }); } catch (_) { /* ignore */ }\n      log('  failed: ' + e.message);\n    }\n  }\n  throw new Error(\n    'Could not download OfficeCLI binary (' + asset + ' @ ' + TAG + '). ' +\n    'Last error: ' + (lastErr && lastErr.message) +\n    '. Install manually from ' + GITHUB_BASE + '/releases'\n  );\n}\n\nmodule.exports = {\n  ensureBinary: ensureBinary,\n  binaryPath: binaryPath,\n  detectAsset: detectAsset,\n  VERSION: VERSION,\n  TAG: TAG\n};\n","sourceCodeStart":221,"sourceCodeEnd":253,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/npm/lib/install-binary.js#L221-L253","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Set HTTPS_PROXY/HTTP_PROXY if you are behind a corporate proxy, or unset a broken proxy, then reinstall.","Confirm the pinned TAG exists and has the asset: open https://github.com/iOfficeAI/OfficeCLI/releases/tag/<TAG>.","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)."],"exampleFix":"// before: Could not download OfficeCLI binary (... @ v1.0.122). Last error: connect ETIMEDOUT\n// after: configure egress/proxy and retry, or place the binary manually\nHTTPS_PROXY=http://corporate-proxy:8080 npm install\n# manual fallback:\ncurl -fsSL https://github.com/iOfficeAI/OfficeCLI/releases/download/<TAG>/officecli-linux-x64 -o node_modules/@officecli/officecli/vendor/officecli\nchmod 0755 node_modules/@officecli/officecli/vendor/officecli","handlingStrategy":"fallback","validationCode":"// Probe egress to both download sources before relying on postinstall\nconst https = require('https');\nfunction 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)); }); }\nconst ok = await reachable('https://d.officecli.ai/install.sh') && await reachable('https://github.com/iOfficeAI/OfficeCLI/releases');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure HTTPS_PROXY in proxy environments.","Pre-download the asset in your image and place it in vendor/ to skip postinstall entirely.","Verify the pinned TAG has published artifacts before cutting a release."],"tags":["install","network","download","binary-distribution","postinstall"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}