Fission-AI/OpenSpec · error · Error
/ exists but is not a directory.
Error message
${relativePath}/ exists but is not a directory. What it means
Structural guard in ensureDirectory: while scaffolding the OpenSpec store, a required relative path exists but pathKind reports it is not a directory (typically a file squatting on a directory name such as specs/).
Solutions
- Inspect the named path and remove or relocate the conflicting file
- Rename the file if its content matters, then retry the root setup
- Re-run the operation that scaffolds the OpenSpec root
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/openspec-root.ts:238 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/8e9f135e2baf0f19.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/openspec-root.ts:238
inspection.healthy =
inspection.present === true &&
inspection.config.present === true &&
inspection.diagnostics.length === 0;
return inspection;
}
async function ensureDirectory(
storeRoot: string,
relativePath: string,
ledger: CreatedPathLedgerEntry[]
): Promise<void> {
const absolutePath = path.join(storeRoot, relativePath);
const kind = await pathKind(absolutePath);
if (kind === 'directory') return;
if (kind !== 'missing') {
throw new Error(`${relativePath}/ exists but is not a directory.`);
}
await fs.mkdir(absolutePath, { recursive: true });
ledger.push({
relativePath: relativeArtifact(relativePath, 'directory'),
absolutePath,
kind: 'directory',
});
}
async function ensureDefaultConfig(
storeRoot: string,
ledger: CreatedPathLedgerEntry[]
): Promise<void> {
const configYamlPath = path.join(storeRoot, OPENSPEC_CONFIG_YAML);
const configYmlPath = path.join(storeRoot, OPENSPEC_CONFIG_YML);
const yamlKind = await pathKind(configYamlPath);
const ymlKind = await pathKind(configYmlPath);View on GitHub (pinned to 6926ccb18a)