davila7/claude-code-templates · warning

Warning: Error loading plugins

Error message

Warning: Error loading plugins

What it means

This is the outer catch of loadInstalledPlugins(): the whole enumeration of ~/.claude/plugins threw (usually the top-level plugins directory doesn't exist — ENOENT — or is unreadable), so the dashboard proceeds with an empty plugin list. Unlike the per-plugin warning above, no plugins load at all.

Source

Thrown at cli-tool/src/plugin-dashboard.js:228

                version: pluginJson.version || '1.0.0',
                description: pluginJson.description || 'No description',
                marketplace: marketplaceDir,
                path: pluginPath,
                components,
                author: pluginJson.author,
                homepage: pluginJson.homepage,
                license: pluginJson.license
              });
            }
          } catch (error) {
            console.warn(chalk.yellow(`Warning: Error loading plugin ${pluginDir}`), error.message);
          }
        }
      }

      return plugins;
    } catch (error) {
      console.warn(chalk.yellow('Warning: Error loading plugins'), error.message);
      return [];
    }
  }

  async loadPluginsFromMarketplace(marketplacePath, marketplaceName) {
    const plugins = [];

    try {
      const marketplaceJsonPath = path.join(marketplacePath, '.claude-plugin', 'marketplace.json');
      const content = await fs.readFile(marketplaceJsonPath, 'utf8');
      const marketplaceData = JSON.parse(content);

      if (!marketplaceData.plugins || !Array.isArray(marketplaceData.plugins)) {
        return [];
      }

      // Process each plugin definition
      for (const pluginDef of marketplaceData.plugins) {

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Create the directory: `mkdir -p ~/.claude/plugins` — the warning then disappears.
  2. Fix permissions: `chmod 755 ~/.claude/plugins`.
  3. Read error.message (printed after the warning) to confirm ENOENT vs EACCES vs EPERM.
  4. Install one plugin via the CLI to bootstrap the directory structure.

Example fix

// before
const plugins = this.loadInstalledPlugins();
// after
const fs = require('fs');
const dir = path.join(os.homedir(), '.claude', 'plugins');
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
const plugins = this.loadInstalledPlugins();
Defensive patterns

Strategy: validation

Validate before calling

const dir = path.join(os.homedir(), '.claude', 'plugins');
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });

Try / catch

catch (e) { if (e.code === 'ENOENT') return []; /* first run, no plugins */ console.warn('Error loading plugins', e.message); return []; }

Prevention

When it happens

Trigger: Starting the plugin dashboard on a machine where ~/.claude/plugins has never been created, or where the directory permissions deny readdir (EACCES). Because ENOENT on the root is not pre-checked, it lands in this generic catch.

Common situations: Fresh install before adding any plugins, a cleanup script that removed ~/.claude/plugins, or shared/managed machines with locked-down home directories.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/f01eafe62bd96683. Report an issue: GitHub.