openai/codex-plugin-cc · error · Error
Missing version.\n\n${usage()}
Error message
Missing version.\n\n${usage()} What it means
Thrown by main() in bump-version.mjs when no version can be determined: the positional version arg was not supplied AND --check was not passed (so package.json was not consulted as a fallback). It appends the full usage text. This is the 'you did not tell me what to do' invocation error.
Source
Thrown at scripts/bump-version.mjs:204
if (JSON.stringify(json) !== before) {
writeJson(root, target.file, json);
changedFiles.push(target.file);
}
}
return changedFiles;
}
function main() {
const options = parseArgs(process.argv.slice(2));
if (options.help) {
console.log(usage());
return;
}
const version = options.version ?? (options.check ? readPackageVersion(options.root) : null);
if (!version) {
throw new Error(`Missing version.\n\n${usage()}`);
}
validateVersion(version);
if (options.check) {
const mismatches = checkVersions(options.root, version);
if (mismatches.length > 0) {
throw new Error(`Version metadata is out of sync:\n${mismatches.join("\n")}`);
}
console.log(`All version metadata matches ${version}.`);
return;
}
const changedFiles = bumpVersion(options.root, version);
const touched = changedFiles.length > 0 ? changedFiles.join(", ") : "no files changed";
console.log(`Set version metadata to ${version}: ${touched}.`);
}
try {View on GitHub (pinned to db52e28f4d)
Solutions
- Pass a version: `node scripts/bump-version.mjs 1.0.0`.
- Or use --check to verify against package.json: `node scripts/bump-version.mjs --check`.
- Run with --help to see full usage.
Example fix
// before $ node scripts/bump-version.mjs // after $ node scripts/bump-version.mjs --check # or $ node scripts/bump-version.mjs 1.0.0
Defensive patterns
Strategy: validation
Validate before calling
function ensureInvocation(argv) {
const hasCheck = argv.includes("--check");
const hasVersion = argv.some((a) => !a.startsWith("-") && !(argv[argv.indexOf(a) - 1] === "--root"));
if (!hasCheck && !hasVersion) {
throw new Error("Missing version. Pass <version> or --check.");
}
} Prevention
- Always pass either a version or --check; never invoke with neither.
- Print --help in wrappers when argv is empty.
- Document the two valid invocation shapes at the top of release scripts.
When it happens
Trigger: Running `node scripts/bump-version.mjs` with no arguments at all, or only flags like `--root /x` without a version and without --check. The version resolves to null and the check-fallback branch is skipped.
Common situations: First-time invocation to discover usage; a wrapper that forwards an empty argv; forgetting --check when intending to verify; expecting the script to auto-derive the next version.
Related errors
- --root requires a directory.
- Unknown option: ${arg}
- Unexpected extra argument: ${arg}
- Usage: node scripts/app-server-broker.mjs serve --endpoint <
- Missing required --endpoint.
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/d8ff34d422c416a0.
Report an issue: GitHub.