affaan-m/ECC · error · Error

Nasiko requires --version v0.1.0.

Error message

Nasiko ${command} requires --version v0.1.0.

What it means

Nasiko mutation commands (install/uninstall) require an explicit --version flag set to v0.1.0. parseMutationArguments validates the accumulated options after parsing and throws this error when no version was supplied. This forces the caller to pin the exact version the script supports rather than silently picking one.

Solutions

  1. Add `--version v0.1.0` to the install/uninstall command line.
  2. If invoked from a script or Makefile, add the flag to the wrapped command definition.
  3. Check that the value is not consumed by a preceding flag (e.g. --install-dir swallowing '--version' as its value).
  4. Update outdated documentation or runbook commands that omit --version.

Example fix

// before
node scripts/nasiko.js install --install-dir ~/.nasiko
// after
node scripts/nasiko.js install --version v0.1.0 --install-dir ~/.nasiko
Defensive patterns

Strategy: validation

Validate before calling

const args = ['install','--version','v0.1.0','--install-dir',dir];
if (!args.includes('--version')) throw new Error('nasiko install requires --version v0.1.0');

Try / catch

try {
  runNasiko(['install','--version','v0.1.0']);
} catch (err) {
  if (err.message.includes('requires --version')) {
    console.error('Add --version v0.1.0 to the nasiko command.');
  } else throw err;
}

Prevention

When it happens

Trigger: Calling the nasiko CLI's install or uninstall command without --version, or with --version but no value that the parser registered (e.g. '--version' as the last argument), then calling options/parseMutationArguments.

Common situations: Running `node scripts/nasiko.js install` copied from older docs that did not require --version; forgetting the flag in CI scripts or npm scripts; typos like `--verison v0.1.0` which fall into the unknown-argument branch or are simply never set.

Understand the failure class

Background: "--flag is required" and "must specify" CLI errors: how missing-required-flag validation works and how to fix it — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at scripts/nasiko.js:52

    if (argument === '--version' || argument === '--install-dir') {
      const value = argumentsList[index + 1];
      if (!value || value.startsWith('--')) throw new Error(`Missing value for ${argument}.`);
      options = {
        ...options,
        [argument === '--version' ? 'version' : 'installDir']: value,
      };
      index += 1;
    } 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 {
      throw new Error(`Unknown Nasiko ${command} argument: ${argument}`);
    }
  }
  if (!options.version) throw new Error(`Nasiko ${command} requires --version v0.1.0.`);
  if (options.installDir) validateInstallDirectory(options.installDir);
  return options;
}

function defaultExecutablePath() {
  const normalized = normalizePlatform();
  if (normalized.os === 'windows') {
    return process.env.LOCALAPPDATA
      ? path.join(process.env.LOCALAPPDATA, 'nasiko', 'bin', normalized.binaryName)
      : null;
  }
  return path.join(os.homedir(), '.local', 'bin', normalized.binaryName);
}

function resolveExecutable(options = {}) {
  const configured = process.env.ECC_NASIKO_CLI_EXECUTABLE;
  const normalized = normalizePlatform();
  const candidate = options.installDir

View on GitHub (pinned to 8321021c54)