iOfficeAI/OfficeCLI · error · Error
Unsupported platform: ${platform} ${arch}. Download manually
Error message
Unsupported platform: ${platform} ${arch}. Download manually from ${GITHUB_BASE}/releases What it means
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.
Source
Thrown at npm/lib/install-binary.js:77
// Default to glibc when nothing positively indicates musl.
return false;
}
function detectAsset() {
const platform = process.platform;
const arch = process.arch;
if (platform === 'darwin') {
if (arch === 'arm64') return 'officecli-mac-arm64';
if (arch === 'x64') return 'officecli-mac-x64';
} else if (platform === 'linux') {
const musl = isMusl();
if (arch === 'x64') return musl ? 'officecli-linux-alpine-x64' : 'officecli-linux-x64';
if (arch === 'arm64') return musl ? 'officecli-linux-alpine-arm64' : 'officecli-linux-arm64';
} else if (platform === 'win32') {
if (arch === 'x64') return 'officecli-win-x64.exe';
if (arch === 'arm64') return 'officecli-win-arm64.exe';
}
throw new Error(
'Unsupported platform: ' + platform + ' ' + arch +
'. Download manually from ' + GITHUB_BASE + '/releases'
);
}
function binaryName() {
return process.platform === 'win32' ? 'officecli.exe' : 'officecli';
}
function binaryPath() {
return path.join(BIN_DIR, binaryName());
}
function assetUrls(asset) {
// Mirror first (issues surface fast), GitHub fallback — same order as
// install.sh. Both use the immutable /releases/download/<tag>/ path.
return [
MIRROR_BASE + '/releases/download/' + TAG + '/' + asset,View on GitHub (pinned to 1ced45e900)
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.
Example fix
// before: npm install fails on linux ia32
// after: install on a supported arch, or pin a binary manually
const oc = require('@officecli/sdk');
const doc = await oc.open('file.xlsx', { binary: '/opt/officecli/officecli-x64' }); Defensive patterns
Strategy: validation
Validate before calling
// Guard an installer/CI step BEFORE triggering the unsupported-platform throw
const SUPPORTED = new Set([
'darwin-arm64','darwin-x64',
'linux-x64','linux-arm64','linux-alpine-x64','linux-alpine-arm64',
'win32-x64','win32-arm64',
]);
const key = `${process.platform}-${process.arch}`;
if (!SUPPORTED.has(key)) {
console.error(`Unsupported ${key}; install a binary manually from the releases page.`);
process.exit(0); // skip postinstall rather than throw
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Could not download OfficeCLI binary (${asset} @ ${TAG}). Las
- Checksum mismatch for ${asset} (expected ${expected}, got ${
- 127
- officecli install failed. Run manually: irm ${INSTALL_PS
- officecli install failed. Run manually: curl -fsSL ${INS
AI-assisted analysis of iOfficeAI/OfficeCLI@1ced45e900 (2026-08-13).
Data as JSON: /api/errors/04d7db99f5c378d7.
Report an issue: GitHub.