affaan-m/ECC · error · Error
An install config path is required
Error message
An install config path is required
What it means
Thrown by resolveInstallConfigPath in scripts/lib/install/config.js when configPath is falsy. The resolver does not fall back to a default — that is the caller's job (findDefaultInstallConfigPath returns the candidate path or null). Any caller that forwards an optional --config flag straight into loadInstallConfig without first resolving a default will hit this.
Source
Thrown at scripts/lib/install/config.js:41
}
const schema = readJson(CONFIG_SCHEMA_PATH, 'ecc-install-config.schema.json');
const ajv = new Ajv({ allErrors: true });
cachedValidator = ajv.compile(schema);
return cachedValidator;
}
function dedupeStrings(values) {
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];
}
function formatValidationErrors(errors = []) {
return errors.map(error => `${error.instancePath || '/'} ${error.message}`).join('; ');
}
function resolveInstallConfigPath(configPath, options = {}) {
if (!configPath) {
throw new Error('An install config path is required');
}
const cwd = options.cwd || process.cwd();
return path.isAbsolute(configPath)
? configPath
: path.normalize(path.join(cwd, configPath));
}
function findDefaultInstallConfigPath(options = {}) {
const cwd = options.cwd || process.cwd();
const candidatePath = path.join(cwd, DEFAULT_INSTALL_CONFIG);
return fs.existsSync(candidatePath) ? candidatePath : null;
}
function loadInstallConfig(configPath, options = {}) {
const resolvedPath = resolveInstallConfigPath(configPath, options);
if (!fs.existsSync(resolvedPath)) {View on GitHub (pinned to 01e15490f0)
Solutions
- Before calling loadInstallConfig, resolve the path: const cfg = configPath || findDefaultInstallConfigPath({ cwd }); if (!cfg) throw ...
- Make --config required in your CLI when no default exists.
- Pass a non-empty string (absolute or relative).
Example fix
// before
const config = loadInstallConfig(options.config);
// after
const configPath = options.config || findDefaultInstallConfigPath({ cwd: process.cwd() });
if (!configPath) {
throw new Error('No install config specified and no ecc-install.json found in cwd');
}
const config = loadInstallConfig(configPath, { cwd: process.cwd() }); Defensive patterns
Strategy: validation
Validate before calling
function requireConfigPath(configPath, options = {}) {
return configPath || findDefaultInstallConfigPath(options);
}
const p = requireConfigPath(options.config, { cwd: process.cwd() });
if (!p) {
throw new Error('No install config specified and no ecc-install.json found in cwd');
} Type guard
function isNonEmptyString(v) {
return typeof v === 'string' && v.length > 0;
} Prevention
- Always pair an optional --config CLI flag with findDefaultInstallConfigPath so an unset flag still resolves.
- Print a helpful error if neither the flag nor a default config exists.
- Document the default ecc-install.json lookup location for users.
When it happens
Trigger: Calling loadInstallConfig(null) or loadInstallConfig('') without first calling findDefaultInstallConfigPath to discover an ecc-install.json in cwd.
Common situations: A CLI that made --config optional but forwards undefined; a wrapper script that reads options.config from an unset env var; a programmatic caller that assumed the loader has a built-in default.
Related errors
- Missing issue number.
- Missing --repo <owner/repo>.
- repoRoot is required to plan Kimi MCP configuration
- Invalid JSON in ${label}: ${error.message}
- Install config not found: ${resolvedPath}
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/19b7323844cd864c.
Report an issue: GitHub.