twentyhq/twenty · error · Error

${fileName} not found in ${appPath}

Error message

${fileName} not found in ${appPath}

What it means

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.

Source

Thrown at packages/twenty-sdk/src/cli/utilities/file/file-find.ts:15

import path from 'path';

import { pathExists } from '@/cli/utilities/file/fs-utils';

export const findPathFile = async (
  appPath: string,
  fileName: string,
): Promise<string> => {
  const jsonPath = path.join(appPath, fileName);

  if (await pathExists(jsonPath)) {
    return jsonPath;
  }

  throw new Error(`${fileName} not found in ${appPath}`);
};

View on GitHub (pinned to 1f5dd2bbd2)

Solutions

  1. Verify the file exists at the expected path: check path.join(appPath, fileName) on disk.
  2. Ensure you are running the CLI from the correct project root directory.
  3. Create the missing file if it is a required project file (e.g. tsconfig.json, package.json).
  4. Check if the file was accidentally .gitignore'd and not committed.
Defensive patterns

Strategy: validation

Validate before calling

import { pathExists } from '@/cli/utilities/file/fs-utils';
import path from 'path';

const ensureFileExists = async (appPath: string, fileName: string): Promise<void> => {
  if (!(await pathExists(path.join(appPath, fileName)))) {
    throw new Error(`Missing required file: ${fileName} in ${appPath}`);
  }
};

await ensureFileExists(appPath, 'package.json');

Try / catch

try {
  const filePath = await findPathFile(appPath, fileName);
} catch (error) {
  if (error instanceof Error && error.message.endsWith(`not found in ${appPath}`)) {
    console.error(`Required file '${fileName}' is missing from ${appPath}.`);
    process.exit(1);
  }
  throw error;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12). Data as JSON: /api/errors/18904e65a95818a2. Report an issue: GitHub.