davila7/claude-code-templates · error · Error
Docker component files not found at: ${componentsDir}
Error message
Docker component files not found at: ${componentsDir} What it means
The Docker sandbox installer checks fs.pathExists on the resolved local componentsDir before copying; a missing directory throws this error. It indicates the packaged catalog references a Docker component folder that doesn't exist on disk.
Source
Thrown at cli-tool/src/index.js:3130
try {
if (await fs.pathExists(componentsDir)) {
console.log(chalk.gray('📦 Using local Docker component files...'));
console.log(chalk.dim(` Source: ${componentsDir}`));
console.log(chalk.dim(` Target: ${sandboxDir}`));
// Copy all files from docker directory
await fs.copy(componentsDir, sandboxDir, {
overwrite: true
});
// Verify files were copied
const copiedFiles = await fs.readdir(sandboxDir);
console.log(chalk.dim(` Copied ${copiedFiles.length} items`));
if (copiedFiles.length === 0) {
throw new Error('No files were copied from Docker component directory');
}
} else {
throw new Error(`Docker component files not found at: ${componentsDir}`);
}
} catch (error) {
spinner.fail(`Failed to install Docker component: ${error.message}`);
throw error;
}
spinner.succeed('Docker sandbox component installed successfully');
// Check for Docker
const dockerSpinner = ora('Checking Docker environment...').start();
try {
const { spawn } = require('child_process');
// Check Docker installation
const checkDocker = () => {
return new Promise((resolve) => {
const check = spawn('docker', ['--version'], { stdio: 'pipe' });View on GitHub (pinned to a0851ed10c)
Solutions
- Run npx claude-code-templates@latest --sandbox docker-<name> (and clear the npx cache) to get a consistent package+catalog
- Confirm the folder exists in the repo and matches the catalog path, then regenerate components.json and republish if it was moved
- Verify the exact slug spelling against the dashboard or components.json
- As a workaround, clone the repo and run the CLI from source (node cli-tool/src/index.js) where the folder is present
Example fix
// before
throw new Error(`Docker component files not found at: ${componentsDir}`);
// after
throw new Error(`Docker component '${componentData.name}' files not found at: ${componentsDir}. Try @latest or check the catalog path.`); Defensive patterns
Strategy: validation
Validate before calling
const ok = await fs.pathExists(componentsDir);
if (!ok) { console.error(`Docker component missing at ${componentsDir}; check slug and update CLI`); process.exit(1); } Try / catch
try { /* install */ } catch (e) { if (/Docker component files not found/.test(e.message)) { /* suggest @latest, verify slug */ } throw e; } Prevention
- Cross-check catalog paths against the filesystem in a publish precheck
- Use exact slugs from the dashboard
When it happens
Trigger: Installing a Docker sandbox component whose folder was moved/deleted while components.json still lists it, or when the npm package was published without that folder.
Common situations: Stale npx cache holding an old package; catalog regenerated from a branch where the component was renamed; typo in the component slug passed to --sandbox.
Related errors
- Cloudflare component files not found at: ${componentsDir}
- Components file not found
- Failed to parse MCP content for ${componentData.name}: ${err
- No files were copied from Cloudflare component directory
- Sandbox Interface Not Found - The sandbox-interface.html fil
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/b1eb232c374539cd.
Report an issue: GitHub.