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
- 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.
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
- 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.
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
- Failed to read file ${filePath}: ${error}
- Directory ${appDirectory} already exists and is not empty
- Could not find the application config file (expected one of:
- defineApplication in ${configPath} must declare a universalI
- Failed to create app registration: ${errorDetail}
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/18904e65a95818a2.
Report an issue: GitHub.