affaan-m/ECC · error

Unsupported architecture: ${architecture}

Error message

Unsupported architecture: ${architecture}

What it means

normalizePlatform in scripts/lib/nasiko-release.js maps Node's 'x64' to 'amd64' and then only accepts 'amd64' and 'arm64'. Any other process.arch value fails this check because no Nasiko binary is qualified for it. This runs before the per-version qualification lookup, so it fires for every install attempt on such hardware/runtime combinations.

Source

Thrown at scripts/lib/nasiko-release.js:35

const MAX_BINARY_BYTES = 64 * 1024 * 1024;
const MAX_METADATA_BYTES = 64 * 1024;
const SHA256_PATTERN = /^sha256:[a-f0-9]{64}$/;

const QUALIFIED_RELEASES = Object.freeze({
  'v0.1.0': Object.freeze({
    'linux/amd64': Object.freeze({ manifestDigest: 'sha256:0df748a40f3d714b6b6a3376a1d13a224c05bdb8d1628f31ace5a7bee8ceb9de', binaryDigest: 'sha256:94a2bcab2d3832257e0111480bb7c3dcac81d63a7ae9bac53206a92c0957ee0f' }),
    'linux/arm64': Object.freeze({ manifestDigest: 'sha256:655021a129c7df4621a80d16ea4eab38018530bfe9a20da646641d9f4ac5c249', binaryDigest: 'sha256:85f9fa5cfbed6c276fce6df2d71e9d0c66d7d8e8d46a40297464833d38db7a7e' }),
    'darwin/amd64': Object.freeze({ manifestDigest: 'sha256:b4188482621efd7da5a2ab630f653665ab5f80b9aceae448b6bb5fc93e003f06', binaryDigest: 'sha256:ed6232e0bb96a2dcfd86d3c25f86021091600d52f09250403a54528bfe8100a3' }),
    'darwin/arm64': Object.freeze({ manifestDigest: 'sha256:ce7e54fa19f989a5d125c4409b3587ca9503bb5a07bc5ff223c60e0fbad437f0', binaryDigest: 'sha256:3c60f862b04eea1b9a633593b39f1a443d9ca2123cf3edfd150d313e95f3894b' }),
    'windows/amd64': Object.freeze({ manifestDigest: 'sha256:0760fe1fc98e8fedb66796aaf891a1de9268af1338c5e88b949656fda5d9f045', binaryDigest: 'sha256:0f57672d24fc3c70e4cbbf22864e65b35b9978ddaae3793803841536e682929b' }),
  }),
});

function normalizePlatform(platform = process.platform, architecture = process.arch) {
  const osName = platform === 'win32' ? 'windows' : platform;
  if (!['linux', 'darwin', 'windows'].includes(osName)) throw new Error(`Unsupported platform: ${platform}`);
  const arch = architecture === 'x64' ? 'amd64' : architecture;
  if (!['amd64', 'arm64'].includes(arch)) throw new Error(`Unsupported architecture: ${architecture}`);
  if (osName === 'windows' && arch !== 'amd64') throw new Error(`Unsupported architecture for Windows: ${architecture}`);
  return { os: osName, arch, binaryName: osName === 'windows' ? 'nasiko.exe' : 'nasiko' };
}

function getQualifiedRelease(version, platform = process.platform, architecture = process.arch) {
  if (!/^v\d+\.\d+\.\d+$/.test(String(version || ''))) {
    throw new Error('Nasiko installation requires a pinned version such as v0.1.0; latest is not allowed.');
  }
  const normalized = normalizePlatform(platform, architecture);
  const qualification = QUALIFIED_RELEASES[version]?.[`${normalized.os}/${normalized.arch}`];
  if (!qualification) throw new Error(`Nasiko ${version} is not qualified for ${normalized.os}/${normalized.arch}.`);
  return { version, ...normalized, ...qualification, license: LICENSE, sourceUrl: SOURCE_URL };
}

function digestBytes(bytes) {
  return `sha256:${crypto.createHash('sha256').update(bytes).digest('hex')}`;
}

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Install a 64-bit Node build (amd64/x64) or an arm64 build so process.arch reports a supported value
  2. On ARMv7 hardware, run the install inside an arm64 or amd64 environment/container
  3. Verify with `node -p process.arch` before invoking the installer

Example fix

# before: 32-bit Node on a 64-bit OS
$ node -p process.arch
ia32
# after: reinstall Node.js x64, then
$ node -p process.arch
x64
Defensive patterns

Strategy: validation

Validate before calling

const NASIKO_ARCHES = new Set(['x64', 'arm64']);
if (!NASIKO_ARCHES.has(process.arch)) {
  throw new Error(`Nasiko install unsupported on ${process.arch}; install a 64-bit Node runtime`);
}

Type guard

type NasikoArch = 'x64' | 'arm64';
const isNasikoArch = (a: string): a is NasikoArch => a === 'x64' || a === 'arm64';

Try / catch

try {
  await installNasiko({ version: 'v0.1.0' });
} catch (error) {
  if (/^Unsupported architecture(?! for Windows)/.test(String(error.message))) {
    // Guide the user to install x64/arm64 Node; not retryable as-is.
  }
  throw error;
}

Prevention

When it happens

Trigger: Calling getQualifiedRelease with architecture 'ia32' (32-bit Node), 'arm' (ARMv7 32-bit boards), 'ppc64'/'ppc64le', 's390x', 'riscv64', or 'loong64'. Most common concrete case: a 32-bit (ia32) Node installation on a 64-bit OS, where process.arch reports 'ia32'.

Common situations: 32-bit Node installed by accident on Windows x64 (the x86 MSI); Raspberry Pi OS with 32-bit userland reporting 'arm'; IBM Power and s390x CI images; exotic RISC-V toolchain containers.

Related errors


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/a78bb594e6fec544. Report an issue: GitHub.