{"record":{"id":"e3cc8571935c06a7","repo":"facebook/flow","slug":"flow-not-found","errorCode":null,"errorMessage":"Flow not found","messagePattern":"Flow not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/flow-for-vscode/src/utils/getFlowPath.ts","lineNumber":74,"sourceCode":"    return flowPath;\n  } catch (err: any) {\n    logger.error(\n      `Error loading flow using option 'pathToFlow'\\n${err.message}`,\n    );\n  }\n\n  // 3) if nothing works fallback to bundled flow\n  if (useBundledFlow) {\n    try {\n      const flowPath = getBundledFlowPath();\n      logger.info('Falling back to bundled flow.');\n      return flowPath;\n    } catch (err: any) {\n      logger.error(`Failed to load bundled flow.\\n${err.message}`);\n    }\n  }\n\n  throw new Error('Flow not found');\n}\n\nasync function getNpmPackagedFlow(\n  flowconfigDir: string,\n  workspaceRoot: string,\n  logger: Logger,\n): Promise<string> {\n  const dirsToCheck = [\n    // a) check in flowconfig dir\n    flowconfigDir,\n    // b) check in workspaceRoot (ignore if flowconfigDir and workspaceRoot same)\n    flowconfigDir !== workspaceRoot ? workspaceRoot : null,\n  ].filter((v) => v != null);\n\n  for (let i = 0; i < dirsToCheck.length; i += 1) {\n    // eslint-disable-next-line no-await-in-loop\n    const flowPath = await getFlowBinPath(dirsToCheck[i], logger);\n    if (flowPath) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/packages/flow-for-vscode/src/utils/getFlowPath.ts#L56-L92","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Verify a flow binary is resolvable before opening/activating\nconst {execSync} = require('child_process');\nfunction flowResolvable() {\n  try { execSync('npx --no-install flow version', {stdio: 'ignore'}); return true; }\n  catch {\n    try { execSync('flow version', {stdio: 'ignore'}); return true; } catch { return false; }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["flow","vscode","extension","binary","installation","path-resolution"],"backgroundTag":"executable-not-found","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","contentChangedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}