{"record":{"id":"1b09cdccccd116b6","repo":"charmbracelet/gum","slug":"gum-version-q-is-not-within-given-range-q","errorCode":null,"errorMessage":"gum version %q is not within given range %q","messagePattern":"gum version %q is not within given range %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"version/command.go","lineNumber":23,"sourceCode":"\t\"fmt\"\n\n\t\"github.com/Masterminds/semver/v3\"\n\t\"github.com/alecthomas/kong\"\n)\n\n// Run check that a given version matches a semantic version constraint.\nfunc (o Options) Run(ctx *kong.Context) error {\n\tc, err := semver.NewConstraint(o.Constraint)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not parse range %s: %w\", o.Constraint, err)\n\t}\n\tcurrent := ctx.Model.Vars()[\"versionNumber\"]\n\tv, err := semver.NewVersion(current)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not parse version %s: %w\", current, err)\n\t}\n\tif !c.Check(v) {\n\t\treturn fmt.Errorf(\"gum version %q is not within given range %q\", current, o.Constraint)\n\t}\n\treturn nil\n}\n","sourceCodeStart":5,"sourceCodeEnd":27,"githubUrl":"https://github.com/charmbracelet/gum/blob/4d089f95507708a71f64dacfe7ca513219dd5267/version/command.go#L5-L27","documentation":"Both the constraint and current version parsed successfully, but the current gum version does not satisfy the given semver constraint. This is not a crash — it's the command's intended failure result indicating a version requirement check failed.","triggerScenarios":"Running `gum version --check <constraint>` where c.Check(v) is false, e.g. requiring '>= 0.14.0' while installed gum is 0.13.0.","commonSituations":"Install scripts verifying minimum gum version before proceeding, CI gate checks for feature availability introduced in a newer gum, stale gum binary on a machine after upgrading scripts.","solutions":["Upgrade gum to a version within the required range (e.g. brew upgrade gum, go install latest)","Relax the constraint in your check script if the newer version isn't actually needed","Verify the installed version with `gum --version`","Ensure PATH resolves the intended gum binary (not an old one)"],"exampleFix":"// before\ngum version --check \">= 0.14.0\"   # installed: 0.13.0 → fails\n// after\nbrew upgrade gum && gum version --check \">= 0.14.0\"","handlingStrategy":"try-catch","validationCode":"installed=$(gum --version | grep -oE '[0-9]+\\.[0-9]+\\.[0-9]+')\nrequired='0.14.0'\nlowest=$(printf '%s\\n%s\\n' \"$installed\" \"$required\" | sort -V | head -n1)\n[ \"$lowest\" = \"$required\" ] || { echo 'gum too old, upgrading'; } ","typeGuard":null,"tryCatchPattern":"if ! gum version --check \">= 0.14.0\"; then\n  echo 'gum is outdated; run: brew upgrade gum' >&2\n  exit 1\nfi","preventionTips":["Pin a minimum gum version in install scripts","Check gum --version after upgrades","Ensure PATH points at the newest gum binary"],"tags":["semver","versioning","cli"],"backgroundTag":"version-constraint-not-satisfied","analyzedSha":"4d089f95507708a71f64dacfe7ca513219dd5267","analyzedAt":"2026-08-31T18:45:06.436Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}