{"record":{"id":"f01eafe62bd96683","repo":"davila7/claude-code-templates","slug":"warning-error-loading-plugins","errorCode":null,"errorMessage":"Warning: Error loading plugins","messagePattern":"Warning: Error loading plugins","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/plugin-dashboard.js","lineNumber":228,"sourceCode":"                version: pluginJson.version || '1.0.0',\n                description: pluginJson.description || 'No description',\n                marketplace: marketplaceDir,\n                path: pluginPath,\n                components,\n                author: pluginJson.author,\n                homepage: pluginJson.homepage,\n                license: pluginJson.license\n              });\n            }\n          } catch (error) {\n            console.warn(chalk.yellow(`Warning: Error loading plugin ${pluginDir}`), error.message);\n          }\n        }\n      }\n\n      return plugins;\n    } catch (error) {\n      console.warn(chalk.yellow('Warning: Error loading plugins'), error.message);\n      return [];\n    }\n  }\n\n  async loadPluginsFromMarketplace(marketplacePath, marketplaceName) {\n    const plugins = [];\n\n    try {\n      const marketplaceJsonPath = path.join(marketplacePath, '.claude-plugin', 'marketplace.json');\n      const content = await fs.readFile(marketplaceJsonPath, 'utf8');\n      const marketplaceData = JSON.parse(content);\n\n      if (!marketplaceData.plugins || !Array.isArray(marketplaceData.plugins)) {\n        return [];\n      }\n\n      // Process each plugin definition\n      for (const pluginDef of marketplaceData.plugins) {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/plugin-dashboard.js#L210-L246","documentation":"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.","triggerScenarios":"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.","commonSituations":"Fresh install before adding any plugins, a cleanup script that removed ~/.claude/plugins, or shared/managed machines with locked-down home directories.","solutions":["Create the directory: `mkdir -p ~/.claude/plugins` — the warning then disappears.","Fix permissions: `chmod 755 ~/.claude/plugins`.","Read error.message (printed after the warning) to confirm ENOENT vs EACCES vs EPERM.","Install one plugin via the CLI to bootstrap the directory structure."],"exampleFix":"// before\nconst plugins = this.loadInstalledPlugins();\n// after\nconst fs = require('fs');\nconst dir = path.join(os.homedir(), '.claude', 'plugins');\nif (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });\nconst plugins = this.loadInstalledPlugins();","handlingStrategy":"validation","validationCode":"const dir = path.join(os.homedir(), '.claude', 'plugins');\nif (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });","typeGuard":null,"tryCatchPattern":"catch (e) { if (e.code === 'ENOENT') return []; /* first run, no plugins */ console.warn('Error loading plugins', e.message); return []; }","preventionTips":["Create the plugins directory eagerly at startup.","Distinguish first-run ENOENT (benign) from EACCES (needs user action) by checking e.code."],"tags":["filesystem","plugins","enoent"],"backgroundTag":"missing-plugins-directory","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}