facebook/flow · error · Error
Flow not found
Error message
Flow not found
What it means
getFlowPath resolves the flow binary in order: (1) npm-packaged flow-bin in the flowconfig dir / workspace root, (2) the pathToFlow setting resolved against those dirs and looked up on PATH, (3) the extension's bundled flow. Each failure is logged; when every enabled strategy fails it throws the terminal 'Flow not found'.
Source
Thrown at packages/flow-for-vscode/src/utils/getFlowPath.ts:74
return flowPath;
} catch (err: any) {
logger.error(
`Error loading flow using option 'pathToFlow'\n${err.message}`,
);
}
// 3) if nothing works fallback to bundled flow
if (useBundledFlow) {
try {
const flowPath = getBundledFlowPath();
logger.info('Falling back to bundled flow.');
return flowPath;
} catch (err: any) {
logger.error(`Failed to load bundled flow.\n${err.message}`);
}
}
throw new Error('Flow not found');
}
async function getNpmPackagedFlow(
flowconfigDir: string,
workspaceRoot: string,
logger: Logger,
): Promise<string> {
const dirsToCheck = [
// a) check in flowconfig dir
flowconfigDir,
// b) check in workspaceRoot (ignore if flowconfigDir and workspaceRoot same)
flowconfigDir !== workspaceRoot ? workspaceRoot : null,
].filter((v) => v != null);
for (let i = 0; i < dirsToCheck.length; i += 1) {
// eslint-disable-next-line no-await-in-loop
const flowPath = await getFlowBinPath(dirsToCheck[i], logger);
if (flowPath) {View on GitHub (pinned to d1341dac89)
Solutions
- Install flow-bin where the extension looks: `npm install --save-dev flow-bin` in the flowconfig dir or workspace root
- Set `flow.pathToFlow` to the absolute path of a working flow binary
- If you disabled bundled flow (`flow.useBundledFlow`), re-enable it or install one of the above
- Read the Flow output channel: every failed strategy logs its reason before the final throw
Example fix
// before (VS Code settings.json)
{ "flow.pathToFlow": "flow", "flow.useNPMPackagedFlow": false }
// after (VS Code settings.json)
{
"flow.pathToFlow": "/abs/path/to/project/node_modules/.bin/flow",
"flow.useNPMPackagedFlow": true
}
// plus: npm install --save-dev flow-bin Defensive patterns
Strategy: fallback
Validate before calling
import {access} from 'fs/promises';
import path from 'path';
async function flowLikelyResolvable(flowconfigDir: string, workspaceRoot: string): Promise<boolean> {
const candidates = [
path.join(flowconfigDir, 'node_modules', '.bin', 'flow'),
path.join(workspaceRoot, 'node_modules', '.bin', 'flow'),
];
for (const c of candidates) {
try { await access(c); return true; } catch {}
}
return false;
} Try / catch
try {
const flowPath = await getFlowPath(params);
} catch (err) {
if (err instanceof Error && err.message === 'Flow not found') {
// prompt the user to install flow-bin or configure pathToFlow,
// then degrade gracefully (no language server)
} else throw err;
} Prevention
- Commit flow-bin as a devDependency of the project owning the .flowconfig
- Use an absolute pathToFlow when relying on custom binaries
- Verify with `npx flow version` after clone/install
When it happens
Trigger: useNPMPackagedFlow enabled but flow-bin not installed in either dir; pathToFlow pointing at a nonexistent command; useBundledFlow disabled or the bundled module missing — or any combination.
Common situations: Fresh clone before `npm install`; pathToFlow set to a global `flow` not on the GUI VS Code process's PATH; bundled flow excluded in custom builds; monorepos where neither flowconfig dir nor workspace root has flow-bin.
Related errors
- '${command}' not found
- Flow version ${version} doesn't support 'flow lsp'. Please u
- Unsupported .flowconfig option `log.file`. The VS Code exten
- Unexpected function parameter ${param.type}
- updatePendingStatements: Variable for dependency "${dep}" no
AI-assisted analysis of facebook/flow@d1341dac89 (2026-08-17).
Data as JSON: /api/errors/e3cc8571935c06a7.
Report an issue: GitHub.