{"record":{"id":"567232f1bb67d905","repo":"heygen-com/hyperframes","slug":"build-zip-ffprobe-static-binary-not-found-under","errorCode":null,"errorMessage":"[build-zip] ffprobe-static binary not found under ${ffprobeModule}/bin/linux/. Did postinstall run?","messagePattern":"\\[build-zip\\] ffprobe-static binary not found under (.+?)/bin/linux/\\. Did postinstall run\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/aws-lambda/scripts/build-zip.ts","lineNumber":429,"sourceCode":"      `[build-zip] ffmpeg-static binary missing at ${ffmpegBinary}. Did postinstall run?`,\n    );\n  }\n  assertLinuxX86_64Elf(ffmpegBinary, \"ffmpeg-static binary\");\n  const ffmpegDest = join(binDir, \"ffmpeg\");\n  cpSync(ffmpegBinary, ffmpegDest);\n  chmodSync(ffmpegDest, 0o755);\n\n  // ffprobe lives at `ffprobe-static/bin/<platform>/<arch>/ffprobe`.\n  // The producer's `audioPadTrim` spawns `ffprobe` from PATH so we need\n  // it alongside ffmpeg under /var/task/bin/.\n  const ffprobeModule = resolveModuleDir(\"ffprobe-static\");\n  const ffprobeCandidates = [\n    join(ffprobeModule, \"bin\", \"linux\", \"x64\", \"ffprobe\"),\n    join(ffprobeModule, \"bin\", \"linux\", \"arm64\", \"ffprobe\"),\n  ];\n  const ffprobeBinary = ffprobeCandidates.find((p) => existsSync(p));\n  if (!ffprobeBinary) {\n    throw new Error(\n      `[build-zip] ffprobe-static binary not found under ${ffprobeModule}/bin/linux/. Did postinstall run?`,\n    );\n  }\n  const ffprobeDest = join(binDir, \"ffprobe\");\n  cpSync(ffprobeBinary, ffprobeDest);\n  chmodSync(ffprobeDest, 0o755);\n\n  console.log(`[build-zip] staged ffmpeg + ffprobe → bin/`);\n}\n\nfunction stageChromeHeadlessShell(stagingDir: string): void {\n  // The fallback path bundles the same chrome-headless-shell binary the\n  // K8s deploy uses. The binary is fetched via `@puppeteer/browsers` on\n  // first build into the host's `~/.cache/puppeteer/`; the build script\n  // re-uses that cache rather than redownloading.\n  const home = process.env.HOME ?? \"/root\";\n  const baseDir = join(home, \".cache\", \"puppeteer\", \"chrome-headless-shell\");\n  if (!existsSync(baseDir)) {","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/heygen-com/hyperframes/blob/c2996c8626135db5253519359d8a063d3bafad8d/packages/aws-lambda/scripts/build-zip.ts#L411-L447","documentation":"The build looks for ffprobe under ffprobe-static/bin/linux/x64/ffprobe or ffprobe-static/bin/linux/arm64/ffprobe. If neither path exists, it throws. The producer's audio pad/trim path spawns ffprobe at runtime, so its absence would cause runtime failures after deploy.","triggerScenarios":"ffprobe-static is installed but its bin/linux/ directory is missing the ffprobe binary — either postinstall did not fetch it, or it fetched for a different platform (e.g., bin/darwin/ instead of bin/linux/).","commonSituations":"Building on macOS where ffprobe-static fetched bin/darwin/arm64/ffprobe instead of the linux variant; postinstall skipped via --ignore-scripts.","solutions":["Install with npm_config_platform=linux and npm_config_arch=x64 so ffprobe-static fetches the linux binary.","Build in a linux/amd64 container.","Reinstall: rm -rf node_modules/ffprobe-static && npm_config_platform=linux npm_config_arch=x64 bun install."],"exampleFix":"// before (on macOS)\nbun install\n\n// after\nnpm_config_platform=linux npm_config_arch=x64 bun install","handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nconst ffprobeModule = resolveModuleDir(\"ffprobe-static\");\nconst candidates = [\n  join(ffprobeModule, \"bin\", \"linux\", \"x64\", \"ffprobe\"),\n  join(ffprobeModule, \"bin\", \"linux\", \"arm64\", \"ffprobe\"),\n];\nif (!candidates.some(existsSync)) {\n  console.error(\"ffprobe-static linux binary missing. Install with npm_config_platform=linux npm_config_arch=x64.\");\n  process.exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set npm_config_platform=linux and npm_config_arch=x64 when installing on non-Linux hosts.","Build in a linux/amd64 container to get the correct platform binaries.","Verify ffprobe-static/bin/linux/ exists after install."],"tags":["ffprobe","postinstall","cross-platform","build"],"backgroundTag":null,"analyzedSha":"c2996c8626135db5253519359d8a063d3bafad8d","analyzedAt":"2026-08-12T22:18:56.877Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}