dmtrKovalenko/fff · error · Error

No npm package available for platform

Error message

No npm package available for platform: ${triple}

What it means

getNpmPackageName() computes the current target triple and looks it up in TRIPLE_TO_NPM_PACKAGE, which only lists the 9 published @ff-labs/fff-bin-* packages. A valid triple with no published package means the install-time downloader cannot know which artifact to fetch, so it throws.

Solutions

  1. Switch to a target with a published package (darwin x64/arm64, linux gnu/musl x64/arm64, win32 x64).
  2. Build the native library from source (`cargo build --release -p fff-c`) and skip npm-based binary resolution.
  3. Check that the expected @ff-labs/fff-bin-* package actually exists on the registry you are using (proxy/verdaccio mirrors may be missing it).
Defensive patterns

Strategy: try-catch

Validate before calling

import { getTriple } from 'fff-bun/platform';
const KNOWN = ['aarch64-apple-darwin','x86_64-apple-darwin','x86_64-unknown-linux-gnu','aarch64-unknown-linux-gnu','x86_64-unknown-linux-musl','aarch64-unknown-linux-musl','x86_64-pc-windows-msvc','aarch64-pc-windows-msvc','aarch64-linux-android'];
if (!KNOWN.includes(getTriple())) throw new Error('no published package for this triple');

Try / catch

try {
  const pkg = getNpmPackageName();
} catch (e) {
  if (String(e.message).startsWith('No npm package available')) {
    // fall back to building from source
    execSync('cargo build --release -p fff-c');
  } else throw e;
}

Prevention

When it happens

Trigger: Running the package download/install step on a supported OS/arch combination that has no published binary package — e.g. x86_64-android, arm-linux-android, windows on arm without the win32-arm64 artifact published, or any new triple added to code before its npm package exists.

Common situations: Android x86_64 emulators, 32-bit ARM devices, CI matrix entries for targets the project does not publish, or a registry/private mirror where the platform package was not published.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of dmtrKovalenko/fff@7f8537e70f (2026-09-10). Data as JSON: /api/errors/15d9b02cde3f1a52. Report an issue: GitHub.

Appendix: source

Thrown at packages/fff-bun/src/platform.ts:125

  "aarch64-unknown-linux-gnu": "@ff-labs/fff-bin-linux-arm64-gnu",
  "x86_64-unknown-linux-musl": "@ff-labs/fff-bin-linux-x64-musl",
  "aarch64-unknown-linux-musl": "@ff-labs/fff-bin-linux-arm64-musl",
  "x86_64-pc-windows-msvc": "@ff-labs/fff-bin-win32-x64",
  "aarch64-pc-windows-msvc": "@ff-labs/fff-bin-win32-arm64",
  "aarch64-linux-android": "@ff-labs/fff-bin-android-arm64",
};

/**
 * Get the npm package name for the current platform's native binary.
 *
 * @returns Package name like "@ff-labs/fff-bin-darwin-arm64"
 * @throws If the current platform is not supported
 */
export function getNpmPackageName(): string {
  const triple = getTriple();
  const packageName = TRIPLE_TO_NPM_PACKAGE[triple];
  if (!packageName) {
    throw new Error(`No npm package available for platform: ${triple}`);
  }
  return packageName;
}

View on GitHub (pinned to 7f8537e70f)