facebook/flow · error · Error
Failed to find anything starting with ${dirPrefix} in ${flow
Error message
Failed to find anything starting with ${dirPrefix} in ${flowBinModulePath} What it means
After confirming the platform prefix (e.g. flow-linux64-v), the extension lists the flow-bin module directory and searches for an entry starting with that prefix. If none is found it throws, naming the prefix and module path — the installed flow-bin package has no binary directory for this platform.
Source
Thrown at packages/flow-for-vscode/src/utils/getVerifiedFlowBinPath.ts:47
? 'flow-win64-v'
: null;
}
async function getFlowBinRelativePath(
flowBinModulePath: string,
): Promise<{ flowBinDirName: string; flowBinName: string }> {
const dirPrefix = getFlowBinDirPrefixForPlatform();
if (!dirPrefix) {
throw new Error(
`Failed to determine correct binary for platform ${process.platform} and arch ${process.arch}`,
);
}
const flowBinModuleContents = await readdir(flowBinModulePath);
const flowBinDirName = flowBinModuleContents.find((x) =>
x.startsWith(dirPrefix),
);
if (!flowBinDirName) {
throw new Error(
`Failed to find anything starting with ${dirPrefix} in ${flowBinModulePath}`,
);
}
const flowBinDir = path.join(flowBinModulePath, flowBinDirName);
const flowBinDirContents = await readdir(flowBinDir);
const flowBinName = flowBinDirContents.find((x) => x.startsWith('flow'));
if (!flowBinName) {
throw new Error(`Failed to find flow binary in ${flowBinDir}`);
}
return { flowBinDirName, flowBinName };
}
async function getShasums(
flowBinModulePath: string,
logger: Logger,
): Promise<Buffer> {
const extensionPath = getExtensionPath();
try {View on GitHub (pinned to d1341dac89)
Solutions
- Force a clean reinstall: remove node_modules/flow-bin and `npm install flow-bin@<same-version>`
- If dirs are still missing, clear the npm cache (`npm cache clean --force`) and reinstall; verify contents with `npm pack flow-bin`
- Inspect the directory named in the error — if the platform dir has a different name, update flow-bin or file an issue
Defensive patterns
Strategy: validation
Validate before calling
import {readdir} from 'fs/promises';
async function hasPlatformDir(
flowBinModulePath: string,
dirPrefix: string,
): Promise<boolean> {
const entries = await readdir(flowBinModulePath).catch(() => [] as string[]);
return entries.some((e) => e.startsWith(dirPrefix));
} Try / catch
try {
const {flowBinDirName, flowBinName} = await getFlowBinRelativePath(p);
} catch (err) {
if (/Failed to find anything starting with/.test(err.message)) {
// treat as corrupt install: prompt reinstall of flow-bin
} else throw err;
} Prevention
- Use npm ci in CI for deterministic installs
- Pin exact flow-bin versions
- Watch for postinstall scripts being disabled, which can leave partial packages
When it happens
Trigger: A corrupted or partial flow-bin install (platform dirs missing), an npm cache fault, a manually pruned package, or a mismatch where the package ships differently-named platform dirs than the prefix expects.
Common situations: Interrupted npm install; npm cache corruption; flow-bin versions with renamed platform directories; antivirus or disk-space issues during extraction.
Related errors
- Pkg flow-bin not found in ${dirsToCheck.join(', ')}
- Failed to determine correct binary for platform ${process.pl
- Failed to verify SHASUM256.txt against public key
- Failed to find SHASUM256.txt line containing ${flowBinRelati
- Hash of ${flowBinPath} does not match hash from SHASUM256.tx
AI-assisted analysis of facebook/flow@d1341dac89 (2026-08-17).
Data as JSON: /api/errors/43375afee71e66de.
Report an issue: GitHub.