{"record":{"id":"18904e65a95818a2","repo":"twentyhq/twenty","slug":"filename-not-found-in-apppath","errorCode":null,"errorMessage":"${fileName} not found in ${appPath}","messagePattern":"(.+?) not found in (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-sdk/src/cli/utilities/file/file-find.ts","lineNumber":15,"sourceCode":"import path from 'path';\n\nimport { pathExists } from '@/cli/utilities/file/fs-utils';\n\nexport const findPathFile = async (\n  appPath: string,\n  fileName: string,\n): Promise<string> => {\n  const jsonPath = path.join(appPath, fileName);\n\n  if (await pathExists(jsonPath)) {\n    return jsonPath;\n  }\n\n  throw new Error(`${fileName} not found in ${appPath}`);\n};\n","sourceCodeStart":1,"sourceCodeEnd":17,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-sdk/src/cli/utilities/file/file-find.ts#L1-L17","documentation":"Thrown by findPathFile when a file with the given fileName does not exist in the specified appPath directory. This is a simple filesystem helper that joins appPath and fileName, checks existence via pathExists, and throws if not found. Used by other SDK CLI utilities to locate required project files.","triggerScenarios":"Calling findPathFile(appPath, fileName) where path.join(appPath, fileName) does not exist on disk. Any SDK CLI operation that needs a specific file (e.g. tsconfig.json, package.json, manifest file) that is missing from the project.","commonSituations":"Running the SDK CLI from the wrong directory (appPath doesn't contain the expected file). The file was deleted, gitignored and not pulled, or the project structure doesn't match what the SDK expects. A file rename occurred that the SDK doesn't account for.","solutions":["Verify the file exists at the expected path: check path.join(appPath, fileName) on disk.","Ensure you are running the CLI from the correct project root directory.","Create the missing file if it is a required project file (e.g. tsconfig.json, package.json).","Check if the file was accidentally .gitignore'd and not committed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { pathExists } from '@/cli/utilities/file/fs-utils';\nimport path from 'path';\n\nconst ensureFileExists = async (appPath: string, fileName: string): Promise<void> => {\n  if (!(await pathExists(path.join(appPath, fileName)))) {\n    throw new Error(`Missing required file: ${fileName} in ${appPath}`);\n  }\n};\n\nawait ensureFileExists(appPath, 'package.json');","typeGuard":null,"tryCatchPattern":"try {\n  const filePath = await findPathFile(appPath, fileName);\n} catch (error) {\n  if (error instanceof Error && error.message.endsWith(`not found in ${appPath}`)) {\n    console.error(`Required file '${fileName}' is missing from ${appPath}.`);\n    process.exit(1);\n  }\n  throw error;\n}","preventionTips":["Run the CLI from the correct project root directory.","Verify required files exist before invoking commands that depend on them.","Use absolute paths when possible to avoid working-directory ambiguity."],"tags":["sdk-cli","filesystem","file-not-found"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}