facebook/flow · error · Error

Failed to find SHASUM256.txt line containing ${flowBinRelati

Error message

Failed to find SHASUM256.txt line containing ${flowBinRelativePath}

What it means

With a checksums file loaded, getShasum searches it for a line containing `<platformDir>/<binaryName>` (e.g. flow-linux64-v0.230.0/flow). If no line mentions that exact relative path it throws — the shasums file does not cover the found binary.

Source

Thrown at packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts:98

  } catch (err: any) {
    logger.info(`Unable to verify SHASUM256.txt.sign:\n${err.message}`);
    return readFile(path.join(extensionPath, 'PAST_FLOW_BIN_SHASUMS.txt'));
  }
}

function getShasum(
  shasums: string,
  flowBinDirName: string,
  flowBinName: string,
): string {
  const flowBinRelativePath = `${flowBinDirName}/${flowBinName}`;
  // eslint-disable-next-line require-unicode-regexp
  const shasumLines = shasums.split(/\r?\n/);
  const shasumLine = shasumLines.find((line) =>
    line.includes(flowBinRelativePath),
  );
  if (!shasumLine) {
    throw new Error(
      `Failed to find SHASUM256.txt line containing ${flowBinRelativePath}`,
    );
  }
  return shasumLine.slice(0, 64);
}

export default async function getVerifiedFlowBinPath(
  flowBinModulePath: string,
  logger: Logger,
): Promise<string> {
  await access(flowBinModulePath);
  try {
    const shasums = await getShasums(flowBinModulePath, logger);

    // successfully verified SHASUM256.txt, now we can use it to verify the flow binary
    const { flowBinDirName, flowBinName } =
      await getFlowBinRelativePath(flowBinModulePath);
    const flowBinPath = path.join(

View on GitHub (pinned to d1341dac89)

Solutions

  1. Reinstall flow-bin cleanly so dir and checksums ship together: `npm ci` or remove node_modules/flow-bin and reinstall
  2. Pin exact matching versions of the extension and flow-bin
  3. If you package flow-bin yourself, include a SHASUM256.txt line for every platform dir you ship
Defensive patterns

Strategy: validation

Validate before calling

function shasumHasEntry(
  shasums: string,
  flowBinDirName: string,
  flowBinName: string,
): boolean {
  const rel = `${flowBinDirName}/${flowBinName}`;
  return shasums
    .split(/\r?\n/)
    .some((line) => line.includes(rel));
}

Try / catch

try {
  const shasum = getShasum(shasums.toString(), dirName, binName);
} catch (err) {
  if (/Failed to find SHASUM256.txt line/.test(err.message)) {
    // dir/checksums version skew: reinstall flow-bin cleanly
  } else throw err;
}

Prevention

When it happens

Trigger: flow-bin's SHASUM256.txt (or the PAST_FLOW_BIN_SHASUMS.txt fallback) has no entry for the platform dir + binary present on disk — version skew between the binary dir and the checksums file, or a manually substituted binary.

Common situations: Mixed-version installs where the platform dir was copied from another flow-bin version; hand-patched node_modules; the fallback file not covering newer binaries.

Related errors


AI-assisted analysis of facebook/flow@d1341dac89 (2026-08-17). Data as JSON: /api/errors/0e2881c398b35eab. Report an issue: GitHub.