facebook/flow · error · Error
Flow not found
Error message
Flow not found
What it means
getFlowPath.ts resolves the flow binary in three stages — configured/PATH flow, npm-packaged flow-bin in the flowconfig dir or workspace root, then bundled flow. If every stage fails (and the bundled-flow fallback also threw), it throws 'Flow not found', meaning no usable flow binary could be located for the workspace.
Solutions
- Install flow locally: npm install --save-dev flow-bin (resolves via the npm-packaged stage).
- Or set the extension's flow path setting (flow.path.flows / path.flow) to an absolute binary path you control.
- Or install flow globally so it is on PATH (e.g. npm i -g flow-bin).
- If bundled flow failed, check the error above this one in the logs, fix network/proxy, and reinstall the extension.
Defensive patterns
Strategy: fallback
Validate before calling
// Verify a flow binary is resolvable before opening/activating
const {execSync} = require('child_process');
function flowResolvable() {
try { execSync('npx --no-install flow version', {stdio: 'ignore'}); return true; }
catch {
try { execSync('flow version', {stdio: 'ignore'}); return true; } catch { return false; }
}
} Prevention
- Add flow-bin as a devDependency at the workspace root so the extension's npm-packaged lookup finds it.
- Alternatively set the extension's flow path setting to an absolute binary.
- Check the extension log's 'Failed to load bundled flow' line when this throws — it names the real cause.
When it happens
Trigger: Workspace with no flow-bin dependency, no flow on PATH, and bundled flow unavailable (platform without a bundled binary, or the extension's download/install corrupted); also when path resolution is disabled and workspace root detection fails in multi-root setups.
Common situations: Opening a project that never set up flow; CI containers missing flow; proxy/firewall blocking the bundled flow download; node_modules with flow-bin installed at a sibling folder root instead of the workspace root.
Related errors
- Flow version doesn't support 'flow lsp'. Please upgrade…
- Unsupported .flowconfig option `log.file`. The VS Code…
- Attempted to insert a statement into
- Cannot insert array into non-array parent type
- Cannot perform a remove mutation on node of type
AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20).
Data as JSON: /api/errors/e3cc8571935c06a7.
Report an issue: GitHub.
Appendix: 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 f88ac94bcf)