jackwener/OpenCLI · info · CommandExecutionError

extensions.json not found: ${TRAE_EXTENSIONS_JSON}

Error message

extensions.json not found: ${TRAE_EXTENSIONS_JSON}

What it means

This CommandExecutionError is thrown by the extensions-list command when the Trae extensions.json file (constant TRAE_EXTENSIONS_JSON) does not exist. It means Trae SOLO has not installed or registered any VSCode-style extensions yet, since that file is only created on first extension installation.

Source

Thrown at clis/trae-solo/workspaces-fs.js:83

            Installed: '',
        }));
    },
});

// -------- extensions-list --------
cli({
    site: 'trae-solo',
    name: 'extensions-list',
    access: 'read',
    description: 'List VSCode extensions installed in Trae SOLO (~/.trae/extensions/extensions.json). Works while Trae is closed.',
    domain: 'localhost',
    browser: false,
    strategy: Strategy.LOCAL,
    args: [],
    columns: ['Index', 'Workspace Id', 'Kind', 'Target', 'Modified', 'Id', 'Version', 'Source', 'Installed'],
    func: async () => {
        if (!fs.existsSync(TRAE_EXTENSIONS_JSON)) {
            throw new CommandExecutionError(
                `extensions.json not found: ${TRAE_EXTENSIONS_JSON}`,
                'Trae SOLO has not installed any VSCode extensions yet.',
            );
        }
        let arr;
        try {
            arr = JSON.parse(fs.readFileSync(TRAE_EXTENSIONS_JSON, 'utf-8'));
        } catch (e) {
            throw new CommandExecutionError(`Failed to parse extensions.json: ${e.message}`, '');
        }
        if (!Array.isArray(arr) || !arr.length) {
            throw new EmptyResultError('trae-solo extensions-list', 'No extensions installed.');
        }
        return arr.map((e, i) => {
            const ts = e?.metadata?.installedTimestamp;
            const installed = ts ? new Date(ts).toISOString().replace('T', ' ').slice(0, 19) : '';
            return {
                Index: i + 1,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Install at least one extension in Trae SOLO so extensions.json is created, then retry
  2. Verify the path in the error message and update TRAE_EXTENSIONS_JSON if it points elsewhere
  3. Search for the actual file (e.g., `find ~/.trae -name extensions.json`) and point the constant at it
  4. Check that the Trae user profile in use matches the path being checked

Example fix

// before
if (!fs.existsSync(TRAE_EXTENSIONS_JSON)) {
    throw new CommandExecutionError(`extensions.json not found: ${TRAE_EXTENSIONS_JSON}`, '');
}
// after
if (!fs.existsSync(TRAE_EXTENSIONS_JSON)) {
    return []; // no extensions installed yet — treat as empty, not an error
}
Defensive patterns

Strategy: fallback

Validate before calling

if (!fs.existsSync(TRAE_EXTENSIONS_JSON)) {
    console.warn('No extensions installed yet; extensions.json not created.');
}

Try / catch

try {
    const rows = await runExtensionsList();
} catch (e) {
    if (/extensions\.json not found/.test(e.message)) {
        return []; // no extensions installed
    }
    throw e;
}

Prevention

When it happens

Trigger: Running extensions-list on a fresh Trae install with no extensions; TRAE_EXTENSIONS_JSON pointing at a wrong/custom extensions path; running as a different OS user so the profile path differs; a Trae update relocating the extensions file.

Common situations: CI or a new machine without extension installs; extensions managed by a different profile or channel (Insiders vs stable); portable installs whose data dir is elsewhere; traversal permissions making existsSync return false.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/6425774ecfe1641e. Report an issue: GitHub.