{"record":{"id":"04d7db99f5c378d7","repo":"iOfficeAI/OfficeCLI","slug":"unsupported-platform-platform-arch-downloa","errorCode":null,"errorMessage":"Unsupported platform: ${platform} ${arch}. Download manually from ${GITHUB_BASE}/releases","messagePattern":"Unsupported platform: (.+?) (.+?)\\. Download manually from (.+?)/releases","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/lib/install-binary.js","lineNumber":77,"sourceCode":"  // Default to glibc when nothing positively indicates musl.\n  return false;\n}\n\nfunction detectAsset() {\n  const platform = process.platform;\n  const arch = process.arch;\n  if (platform === 'darwin') {\n    if (arch === 'arm64') return 'officecli-mac-arm64';\n    if (arch === 'x64') return 'officecli-mac-x64';\n  } else if (platform === 'linux') {\n    const musl = isMusl();\n    if (arch === 'x64') return musl ? 'officecli-linux-alpine-x64' : 'officecli-linux-x64';\n    if (arch === 'arm64') return musl ? 'officecli-linux-alpine-arm64' : 'officecli-linux-arm64';\n  } else if (platform === 'win32') {\n    if (arch === 'x64') return 'officecli-win-x64.exe';\n    if (arch === 'arm64') return 'officecli-win-arm64.exe';\n  }\n  throw new Error(\n    'Unsupported platform: ' + platform + ' ' + arch +\n    '. Download manually from ' + GITHUB_BASE + '/releases'\n  );\n}\n\nfunction binaryName() {\n  return process.platform === 'win32' ? 'officecli.exe' : 'officecli';\n}\n\nfunction binaryPath() {\n  return path.join(BIN_DIR, binaryName());\n}\n\nfunction assetUrls(asset) {\n  // Mirror first (issues surface fast), GitHub fallback — same order as\n  // install.sh. Both use the immutable /releases/download/<tag>/ path.\n  return [\n    MIRROR_BASE + '/releases/download/' + TAG + '/' + asset,","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/npm/lib/install-binary.js#L59-L95","documentation":"Thrown by detectAsset() in the npm postinstall hook when process.platform/process.arch is not in the supported matrix (darwin/linux/win32 × arm64/x64). The package ships no native code, so it must fetch a matching prebuilt binary; with no asset for the current OS/arch pair it cannot proceed and aborts install. The message points to GitHub releases as the manual fallback.","triggerScenarios":"Running `npm install` (postinstall) on an OS/arch pair outside the matrix: e.g. linux ia32/x86/s390x/ppc64, freebsd, aix, sunos, win32 ia32, or any system whose musl/glibc detection resolves but whose arch is unsupported. Any platform where detectAsset() falls through every if/else branch.","commonSituations":"CI on an unusual runner (32-bit, IBM/ARM other than arm64, FreeBSD, Alpine x86); building inside an i686 container; cross-arch emulation where Node reports an arch with no published asset; a brand-new arch (e.g. linux armv7l / riscv64) the publisher hasn't built for.","solutions":["Confirm the unsupported pair: run `node -e \"console.log(process.platform, process.arch)\"` and compare against the supported matrix (darwin/linux/win32 × x64/arm64).","Download the closest matching binary manually from https://github.com/iOfficeAI/OfficeCLI/releases and place it on PATH (or pass {binary: '/path/to/officecli'} to the SDK).","If the arch is genuinely unsupported, run Node under an emulator (e.g. Rosetta 2 on Apple-silicon for an x64-only build, or qemu) so process.arch reports a supported value.","Open an issue upstream requesting an asset for platform/arch if the platform is common."],"exampleFix":"// before: npm install fails on linux ia32\n// after: install on a supported arch, or pin a binary manually\nconst oc = require('@officecli/sdk');\nconst doc = await oc.open('file.xlsx', { binary: '/opt/officecli/officecli-x64' });","handlingStrategy":"validation","validationCode":"// Guard an installer/CI step BEFORE triggering the unsupported-platform throw\nconst SUPPORTED = new Set([\n  'darwin-arm64','darwin-x64',\n  'linux-x64','linux-arm64','linux-alpine-x64','linux-alpine-arm64',\n  'win32-x64','win32-arm64',\n]);\nconst key = `${process.platform}-${process.arch}`;\nif (!SUPPORTED.has(key)) {\n  console.error(`Unsupported ${key}; install a binary manually from the releases page.`);\n  process.exit(0); // skip postinstall rather than throw\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin your CI runners to a supported OS/arch (darwin/linux/win32 × x64/arm64).","Pre-stage the binary and pass {binary} explicitly instead of relying on postinstall detection."],"tags":["install","platform","binary-distribution","postinstall"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}