affaan-m/ECC · error · Error

Value for is too long.

Error message

Value for ${argument} is too long.

What it means

parseArgs in scripts/install-guided.js enforces a 256-character limit on every value passed to a value flag. Oversized values are rejected to prevent absurd inputs, buffer bloat, and injection-sized payloads from reaching downstream config or shell steps.

Solutions

  1. Shorten the value — use a shorter relative path or identifier
  2. Check the command for accidental paste or glob expansion (`echo` the args first)
  3. If the value is a path, cd into the tree and pass a relative path instead
  4. If 256 chars is genuinely needed, this is unsupported; restructure the input

Example fix

// before
node scripts/install-guided.js --root /very/long/path/... (>256 chars)
// after
cd /very/long/path && node /path/to/scripts/install-guided.js --root .
Defensive patterns

Strategy: validation

Validate before calling

if (typeof value === 'string' && value.length > 256) {
  throw new Error(`Value for ${flag} is too long (max 256 chars).`);
}
// check before invoking install-guided.js

Type guard

const isAcceptableValue = (v) => typeof v === 'string' && v.length > 0 && v.length <= 256;

Try / catch

try {
  parseArgs(rawArgv);
} catch (err) {
  if (err.message.includes('is too long')) {
    console.error(`${err.message} Pass a shorter path or identifier.`);
    process.exit(2);
  }
  throw err;
}

Prevention

When it happens

Trigger: Passing a --harness, --root, or similar value longer than 256 characters — e.g. a deeply nested path, a blob pasted by mistake, or an unquoted glob expansion feeding a huge token.

Common situations: Very deep project paths on Windows, accidentally pasting file contents as a flag value, shell glob expansion producing one giant argument.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/7fdd20430786045d. Report an issue: GitHub.

Appendix: source

Thrown at scripts/install-guided.js:85

    profile: undefined,
    yes: false,
  };
  const valueFlags = new Map([
    ['--harness', 'harnesses'],
    ['--claude-scope', 'claudeScope'],
    ['--claude-hooks', 'claudeHooks'],
    ['--profile', 'profile'],
  ]);

  for (let index = 0; index < argv.length; index += 1) {
    const argument = argv[index];
    if (valueFlags.has(argument)) {
      const value = argv[index + 1];
      if (!value || value.startsWith('--')) {
        throw new Error(`Missing value for ${argument}`);
      }
      if (value.length > 256) {
        throw new Error(`Value for ${argument} is too long.`);
      }
      const key = valueFlags.get(argument);
      options = key === 'harnesses'
        ? { ...options, harnesses: [...options.harnesses, value] }
        : { ...options, [key]: value };
      index += 1;
    } else if (argument === '--all-harnesses') {
      options = { ...options, allHarnesses: true };
    } else if (argument === '--yes' || argument === '-y') {
      options = { ...options, yes: true };
    } else if (argument === '--dry-run') {
      options = { ...options, dryRun: true };
    } else if (argument === '--json') {
      options = { ...options, json: true };
    } else if (argument === '--help' || argument === '-h') {
      options = { ...options, help: true };
    } else {
      throw new Error('Unknown argument. Run guided install with --help to see valid options.');

View on GitHub (pinned to 8321021c54)