heygen-com/hyperframes · error · Error

[build-zip] ffmpeg-static binary missing at ${ffmpegBinary}.

Error message

[build-zip] ffmpeg-static binary missing at ${ffmpegBinary}. Did postinstall run?

What it means

After resolving the ffmpeg-static module directory, the build checks for a file named 'ffmpeg' (no extension) inside it. If the file does not exist, it throws. This means the ffmpeg-static postinstall script that downloads the prebuilt binary either did not run or failed silently.

Source

Thrown at packages/aws-lambda/scripts/build-zip.ts:410

  }
}

function stageFfmpeg(stagingDir: string): void {
  const binDir = join(stagingDir, "bin");
  mkdirSync(binDir, { recursive: true });

  // ffmpeg from `ffmpeg-static`. The package only ships the encoder
  // binary; the audio pad/trim path also needs ffprobe, which comes
  // from `ffprobe-static`.
  //
  // `ffmpeg-static`'s postinstall fetches a binary for the host platform
  // (e.g. arm64 Mach-O on Apple Silicon macOS). Lambda runs Linux x86-64,
  // so a build from a non-Linux host silently produces a zip that boots
  // but fails at first ffmpeg invocation with `cannot execute binary file`.
  // Verify the ELF header up front and bail with a clear message instead.
  const ffmpegBinary = join(resolveModuleDir("ffmpeg-static"), "ffmpeg");
  if (!existsSync(ffmpegBinary)) {
    throw new Error(
      `[build-zip] ffmpeg-static binary missing at ${ffmpegBinary}. Did postinstall run?`,
    );
  }
  assertLinuxX86_64Elf(ffmpegBinary, "ffmpeg-static binary");
  const ffmpegDest = join(binDir, "ffmpeg");
  cpSync(ffmpegBinary, ffmpegDest);
  chmodSync(ffmpegDest, 0o755);

  // ffprobe lives at `ffprobe-static/bin/<platform>/<arch>/ffprobe`.
  // The producer's `audioPadTrim` spawns `ffprobe` from PATH so we need
  // it alongside ffmpeg under /var/task/bin/.
  const ffprobeModule = resolveModuleDir("ffprobe-static");
  const ffprobeCandidates = [
    join(ffprobeModule, "bin", "linux", "x64", "ffprobe"),
    join(ffprobeModule, "bin", "linux", "arm64", "ffprobe"),
  ];
  const ffprobeBinary = ffprobeCandidates.find((p) => existsSync(p));
  if (!ffprobeBinary) {

View on GitHub (pinned to c2996c8626)

Solutions

  1. Reinstall without --ignore-scripts: ensure scripts are not ignored during bun install.
  2. Manually trigger the postinstall: cd node_modules/ffmpeg-static && npm run install.
  3. Check that npm_config_ignore_scripts is not set in the environment.
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from "node:fs";
import { join } from "node:path";
const ffmpegBinary = join(resolveModuleDir("ffmpeg-static"), "ffmpeg");
if (!existsSync(ffmpegBinary)) {
  console.error("ffmpeg-static binary missing. Ensure postinstall ran during install (no --ignore-scripts).");
  process.exit(1);
}

Prevention

When it happens

Trigger: ffmpeg-static is present in node_modules but its ffmpeg binary is absent. The postinstall hook was skipped (e.g., --ignore-scripts) or failed due to network issues.

Common situations: Installing with --ignore-scripts or with npm_config_ignore_scripts=true; postinstall failed due to network timeout; CI that strips postinstall scripts for security.

Related errors


AI-assisted analysis of heygen-com/hyperframes@c2996c8626 (2026-08-12). Data as JSON: /api/errors/edaa840d2e275faa. Report an issue: GitHub.