tinyhumansai/openhuman · error · Error

Unsupported platform: ${platform}

Error message

Unsupported platform: ${platform}

What it means

The npm postinstall script maps process.platform/process.arch to a Rust target triple via TARGET_MAP to select a prebuilt openhuman-core archive; an OS not present in the map (only darwin, linux, win32) has no prebuilt artifact, so installation aborts immediately.

Source

Thrown at packages/npm/install.js:30

const crypto = require('crypto');
const { execFileSync } = require('child_process');

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));

View on GitHub (pinned to a221052e0d)

Solutions

  1. Install on a supported OS (macOS, GNU/Linux, Windows)
  2. Otherwise clone the repo and build from source: cargo build --release --bin openhuman-core, then npm install --ignore-scripts and point to your binary
  3. File an issue requesting the target triple if you can supply builds for it
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_PLATFORMS = ['darwin', 'linux', 'win32'];
if (!SUPPORTED_PLATFORMS.includes(process.platform)) {
  console.error(`No prebuilt openhuman-core for ${process.platform}; build from source`);
  process.exit(1);
}

Type guard

const hasPrebuilt = (p: NodeJS.Platform): p is 'darwin' | 'linux' | 'win32' =>
  p === 'darwin' || p === 'linux' || p === 'win32';

Prevention

When it happens

Trigger: npm install on an OS outside {darwin, linux, win32}: FreeBSD/OpenBSD jails, Android Termux, Solaris/SmartOS containers.

Common situations: Installing the CLI inside Termux or a BSD sandbox; exotic CI runner images.

Related errors


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