openai/codex-plugin-cc · error · Error

Version metadata is out of sync:\n${mismatches.join("\n")}

Error message

Version metadata is out of sync:\n${mismatches.join("\n")}

What it means

Thrown by main()/checkVersions() during --check when one or more of the four target manifests (package.json, package-lock.json, plugin.json, marketplace.json — each with one or more version fields) hold a version that differs from the expected version. The message lists every mismatch with file, field label, expected vs found value. It enforces that all version metadata across the repo is in sync.

Source

Thrown at scripts/bump-version.mjs:211

}

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 {
  main();
} catch (error) {
  console.error(error instanceof Error ? error.message : String(error));
  process.exitCode = 1;
}

View on GitHub (pinned to db52e28f4d)

Solutions

  1. Run `node scripts/bump-version.mjs <target-version>` (without --check) to write the version into all manifests and resync them.
  2. Manually correct the specific drifted file(s) listed in the mismatch output.
  3. Re-run --check to confirm all fields agree.

Example fix

// before
$ node scripts/bump-version.mjs --check
# Version metadata is out of sync:
# package-lock.json version: expected 1.0.3, found 1.0.2

// after
$ node scripts/bump-version.mjs 1.0.3
$ node scripts/bump-version.mjs --check
# All version metadata matches 1.0.3.
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight: ensure all tracked fields already equal the target before --check.
function versionsInSync(root, expected) {
  const mismatches = checkVersions(root, expected);
  return mismatches.length === 0;
}

if (!versionsInSync(root, target)) {
  // run the bump (without --check) to resync, then re-check
  bumpVersion(root, target);
}

Try / catch

try {
  // run check in CI
} catch (err) {
  if (/Version metadata is out of sync/.test(err.message)) {
    // fail the release gate; require a bump commit
  } else throw err;
}

Prevention

When it happens

Trigger: Running `node scripts/bump-version.mjs --check [version]` where any tracked version field disagrees. With an explicit version, that is the expected value; without one, package.json's version is the baseline. A single drifted field (e.g. package-lock.json not updated) triggers it.

Common situations: Bumping package.json manually but forgetting package-lock.json or marketplace.json; an npm install rewriting package-lock.json's version; plugin.json version left behind after a release; partial version bump interrupted mid-way.

Related errors


AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13). Data as JSON: /api/errors/9d9d809f288a80be. Report an issue: GitHub.