{"record":{"id":"8ee1fa26c7736772","repo":"coreybutler/nvm-windows","slug":"unrecognized-version-s","errorCode":null,"errorMessage":"Unrecognized version: \"%s\"","messagePattern":"Unrecognized version: \"(.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/nvm.go","lineNumber":392,"sourceCode":"\tif err == nil {\n\t\t// if the user specifies only the major/minor version, identify the latest\n\t\t// version applicable to what was provided.\n\t\tsv := strings.Split(version, \".\")\n\t\tif len(sv) < 3 {\n\t\t\tversion = findLatestSubVersion(version)\n\t\t} else {\n\t\t\tversion = cleanVersion(version)\n\t\t}\n\n\t\tversion = versionNumberFrom(version)\n\t} else if strings.Contains(err.Error(), \"No Major.Minor.Patch\") {\n\t\tlatestLocalInstall := false\n\t\tif len(localInstallsOnly) > 0 {\n\t\t\tlatestLocalInstall = localInstallsOnly[0]\n\t\t}\n\t\tversion = findLatestSubVersion(version, latestLocalInstall)\n\t\tif len(version) == 0 {\n\t\t\terr = errors.New(\"Unrecognized version: \\\"\" + requestedVersion + \"\\\"\")\n\t\t}\n\t}\n\n\treturn version, cpuarch, err\n}\n\ntype Status struct {\n\tText string\n\tErr  error\n\tDone bool\n\tHelp bool\n}\n\nfunc rollback(version string) error {\n\tp := filepath.Join(env.root, \"v\"+version)\n\n\t_, err := os.Lstat(p)\n\tif err != nil {","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/coreybutler/nvm-windows/blob/5b18223ca19ff50d707f35410dbc6bd440a9f74d/src/nvm.go#L374-L410","documentation":"Returned by getVersion() when the input could not be coerced into a concrete x.y.z version: the semver machinery reported \"No Major.Minor.Patch\" and a follow-up findLatestSubVersion(version, localOnly) lookup (against the index of available/installed versions) also produced an empty string. It reports the user's original requestedVersion, not the mangled one.","triggerScenarios":"Passing something that is neither a semantic version, a known alias, nor a resolvable major.minor stream — e.g. `nvm install 2O.11.0` (typo with letter O), `nvm install v20` where 20 is not a resolvable stream, or `nvm install \"\"` variants that slip past earlier checks. Also `nvm install 4.0` when offline and only local lookups are possible (localInstallsOnly=true finds no match).","commonSituations":"Copy-pasting version strings with unicode digits or a leading 'v' plus partial version; offline machines where findLatestSubVersion cannot consult the remote index; version streams that never existed (e.g. `nvm install 99`).","solutions":["Pass a full semantic version, e.g. `nvm install 20.11.0` (leading 'v' is tolerated by versionNumberFrom, but full x.y.z is safest).","Use aliases latest/lts/newest instead of hand-typed partial versions.","If offline, install a version that is already cached locally or check connectivity, since sub-version resolution needs the index.","Run `nvm ls available` to see valid version identifiers."],"exampleFix":"# before\nnvm install 2O.11.0\n# after\nnvm install 20.11.0","handlingStrategy":"validation","validationCode":"# bash: validate the version token before invoking nvm\nif ! printf '%s' \"$V\" | grep -qE '^v?[0-9]+(\\.[0-9]+){0,2}$'; then\n  echo \"not a semantic version: $V\" >&2; exit 1\nfi\nnvm install \"$V\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin full x.y.z versions in CI rather than partial ones.","Prefer the latest/lts aliases over hand-typed streams.","Stay online (or pre-install) when resolving partial versions — sub-version lookup needs the index."],"tags":["nvm-windows","semver","version-resolution","cli"],"backgroundTag":null,"analyzedSha":"5b18223ca19ff50d707f35410dbc6bd440a9f74d","analyzedAt":"2026-08-15T10:06:51.428Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}