{"record":{"id":"fe41181f576adbbe","repo":"tinyhumansai/openhuman","slug":"unsupported-platform-platform","errorCode":null,"errorMessage":"Unsupported platform: ${platform}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/npm/install.js","lineNumber":30,"sourceCode":"const crypto = require('crypto');\nconst { execFileSync } = require('child_process');\n\nconst REPO = 'tinyhumansai/openhuman';\nconst pkg = require('./package.json');\nconst VERSION = pkg.version;\n\n// Maps process.platform + process.arch → Rust target triple\nconst TARGET_MAP = {\n  darwin: { x64: 'x86_64-apple-darwin', arm64: 'aarch64-apple-darwin' },\n  linux: { x64: 'x86_64-unknown-linux-gnu', arm64: 'aarch64-unknown-linux-gnu' },\n  win32: { x64: 'x86_64-pc-windows-msvc' },\n};\n\nfunction getTarget() {\n  const platform = process.platform;\n  const arch = process.arch;\n  const targets = TARGET_MAP[platform];\n  if (!targets) throw new Error(`Unsupported platform: ${platform}`);\n  const target = targets[arch];\n  if (!target) throw new Error(`Unsupported arch ${arch} on ${platform}`);\n  return { platform, target };\n}\n\nfunction httpsGet(url) {\n  return new Promise((resolve, reject) => {\n    function request(u) {\n      https.get(u, (res) => {\n        if (res.statusCode === 301 || res.statusCode === 302) {\n          return request(res.headers.location);\n        }\n        if (res.statusCode !== 200) {\n          res.resume();\n          return reject(new Error(`HTTP ${res.statusCode} fetching ${u}`));\n        }\n        const chunks = [];\n        res.on('data', (c) => chunks.push(c));","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/packages/npm/install.js#L12-L48","documentation":"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.","triggerScenarios":"npm install on an OS outside {darwin, linux, win32}: FreeBSD/OpenBSD jails, Android Termux, Solaris/SmartOS containers.","commonSituations":"Installing the CLI inside Termux or a BSD sandbox; exotic CI runner images.","solutions":["Install on a supported OS (macOS, GNU/Linux, Windows)","Otherwise clone the repo and build from source: cargo build --release --bin openhuman-core, then npm install --ignore-scripts and point to your binary","File an issue requesting the target triple if you can supply builds for it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const SUPPORTED_PLATFORMS = ['darwin', 'linux', 'win32'];\nif (!SUPPORTED_PLATFORMS.includes(process.platform)) {\n  console.error(`No prebuilt openhuman-core for ${process.platform}; build from source`);\n  process.exit(1);\n}","typeGuard":"const hasPrebuilt = (p: NodeJS.Platform): p is 'darwin' | 'linux' | 'win32' =>\n  p === 'darwin' || p === 'linux' || p === 'win32';","tryCatchPattern":null,"preventionTips":["Check `node -p process.platform` before installing on unusual hosts","In Dockerfiles, base on glibc Linux images (debian/ubuntu), not Alpine-musl unless a musl triple exists","Use npm install --ignore-scripts and a source build when no prebuilt maps"],"tags":["npm","install","platform","prebuilt"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}