{"record":{"id":"a161b9be93600bfb","repo":"affaan-m/ECC","slug":"nasiko-command-requires-version-v0-1-0","errorCode":null,"errorMessage":"Nasiko ${command} requires --version v0.1.0.","messagePattern":"Nasiko (.+?) requires --version v0\\.1\\.0\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/nasiko.js","lineNumber":52,"sourceCode":"    if (argument === '--version' || argument === '--install-dir') {\n      const value = argumentsList[index + 1];\n      if (!value || value.startsWith('--')) throw new Error(`Missing value for ${argument}.`);\n      options = {\n        ...options,\n        [argument === '--version' ? 'version' : 'installDir']: value,\n      };\n      index += 1;\n    } else if (argument === '--yes' || argument === '-y') {\n      options = { ...options, yes: true };\n    } else if (argument === '--dry-run') {\n      options = { ...options, dryRun: true };\n    } else if (argument === '--json') {\n      options = { ...options, json: true };\n    } else {\n      throw new Error(`Unknown Nasiko ${command} argument: ${argument}`);\n    }\n  }\n  if (!options.version) throw new Error(`Nasiko ${command} requires --version v0.1.0.`);\n  if (options.installDir) validateInstallDirectory(options.installDir);\n  return options;\n}\n\nfunction defaultExecutablePath() {\n  const normalized = normalizePlatform();\n  if (normalized.os === 'windows') {\n    return process.env.LOCALAPPDATA\n      ? path.join(process.env.LOCALAPPDATA, 'nasiko', 'bin', normalized.binaryName)\n      : null;\n  }\n  return path.join(os.homedir(), '.local', 'bin', normalized.binaryName);\n}\n\nfunction resolveExecutable(options = {}) {\n  const configured = process.env.ECC_NASIKO_CLI_EXECUTABLE;\n  const normalized = normalizePlatform();\n  const candidate = options.installDir","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/nasiko.js#L34-L70","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add `--version v0.1.0` to the install/uninstall command line.","If invoked from a script or Makefile, add the flag to the wrapped command definition.","Check that the value is not consumed by a preceding flag (e.g. --install-dir swallowing '--version' as its value).","Update outdated documentation or runbook commands that omit --version."],"exampleFix":"// before\nnode scripts/nasiko.js install --install-dir ~/.nasiko\n// after\nnode scripts/nasiko.js install --version v0.1.0 --install-dir ~/.nasiko","handlingStrategy":"validation","validationCode":"const args = ['install','--version','v0.1.0','--install-dir',dir];\nif (!args.includes('--version')) throw new Error('nasiko install requires --version v0.1.0');","typeGuard":null,"tryCatchPattern":"try {\n  runNasiko(['install','--version','v0.1.0']);\n} catch (err) {\n  if (err.message.includes('requires --version')) {\n    console.error('Add --version v0.1.0 to the nasiko command.');\n  } else throw err;\n}","preventionTips":["Always include --version in nasiko install/uninstall invocations.","Centralize the nasiko command line in one script/Makefile target so the flag is never omitted.","Lint CI configs for the presence of --version next to nasiko commands.","Avoid placing --version right after --install-dir so it is not swallowed as a value."],"tags":["cli","missing-flag","validation"],"backgroundTag":"missing-required-flag","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}