tinyhumansai/openhuman · error · Error

Unsupported arch ${arch} on ${platform}

Error message

Unsupported arch ${arch} on ${platform}

What it means

The OS is supported but process.arch has no entry under TARGET_MAP[platform] — win32 supports only x64, linux and darwin x64/arm64 — so no prebuilt tarball matches the machine and installation aborts.

Source

Thrown at packages/npm/install.js:32

const REPO = 'tinyhumansai/openhuman';
const pkg = require('./package.json');
const VERSION = pkg.version;

// Maps process.platform + process.arch → Rust target triple
const TARGET_MAP = {
  darwin: { x64: 'x86_64-apple-darwin', arm64: 'aarch64-apple-darwin' },
  linux: { x64: 'x86_64-unknown-linux-gnu', arm64: 'aarch64-unknown-linux-gnu' },
  win32: { x64: 'x86_64-pc-windows-msvc' },
};

function getTarget() {
  const platform = process.platform;
  const arch = process.arch;
  const targets = TARGET_MAP[platform];
  if (!targets) throw new Error(`Unsupported platform: ${platform}`);
  const target = targets[arch];
  if (!target) throw new Error(`Unsupported arch ${arch} on ${platform}`);
  return { platform, target };
}

function httpsGet(url) {
  return new Promise((resolve, reject) => {
    function request(u) {
      https.get(u, (res) => {
        if (res.statusCode === 301 || res.statusCode === 302) {
          return request(res.headers.location);
        }
        if (res.statusCode !== 200) {
          res.resume();
          return reject(new Error(`HTTP ${res.statusCode} fetching ${u}`));
        }
        const chunks = [];
        res.on('data', (c) => chunks.push(c));
        res.on('end', () => resolve(Buffer.concat(chunks)));
        res.on('error', reject);

View on GitHub (pinned to a221052e0d)

Solutions

  1. Install an x64 Node build on Windows ARM (runs via emulation) so process.arch maps to x86_64-pc-windows-msvc
  2. Verify what you have: node -p "process.platform + ' ' + process.arch"
  3. Or build openhuman-core from source for the exotic arch and skip the download
Defensive patterns

Strategy: validation

Validate before calling

const ARCHES = { darwin: ['x64', 'arm64'], linux: ['x64', 'arm64'], win32: ['x64'] };
const ok = !!ARCHES[process.platform]?.includes(process.arch);
if (!ok) console.error(`No prebuilt for ${process.arch} on ${process.platform}`);

Type guard

const hasPrebuiltArch = (p: string, a: string): boolean =>
  ({ darwin: ['x64','arm64'], linux: ['x64','arm64'], win32: ['x64'] })[p]?.includes(a) ?? false;

Prevention

When it happens

Trigger: Windows on ARM64 running an arm64 Node build (win32/arm64 is unmapped); linux ia32 or riscv64; any arch outside x64/arm64.

Common situations: Windows ARM laptops (Snapdragon) with native arm64 Node; 32-bit Node installed on a 64-bit Linux.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/b533322ad713f468. Report an issue: GitHub.