{"record":{"id":"1aee1825117bedc0","repo":"coreybutler/nvm-windows","slug":"version-not-installed-run-nvm-ls-to-see-availab","errorCode":null,"errorMessage":"Version not installed. Run \"nvm ls\" to see available versions.","messagePattern":"Version not installed\\. Run \"nvm ls\" to see available versions\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/nvm.go","lineNumber":1174,"sourceCode":"\n\t\t// Check if a change is needed\n\t\tcurVersion, curCpuarch := node.GetCurrentVersion()\n\t\tif version == curVersion && cpuarch == curCpuarch {\n\t\t\tfmt.Println(\"node v\" + version + \" (\" + cpuarch + \"-bit) is already in use.\")\n\t\t\tstatus <- Status{Done: true}\n\t\t\treturn\n\t\t}\n\n\t\t// Make sure the version is installed. If not, warn.\n\t\tif !node.IsVersionInstalled(env.root, version, cpuarch) {\n\t\t\terr = fmt.Errorf(\"node v%s (%v-bit) is not installed.\", version, cpuarch)\n\t\t\tif notifications {\n\t\t\t\tstatus <- Status{Err: err, Done: true}\n\t\t\t}\n\t\t\tif (cpuarch == \"32\" && node.IsVersionInstalled(env.root, version, \"64\")) || (cpuarch == \"64\" && node.IsVersionInstalled(env.root, version, \"32\")) {\n\t\t\t\tstatus <- Status{Err: fmt.Errorf(\"Did you mean node v%s (%v-bit)?\\nIf so, type \\\"nvm use %s %v\\\" to use it.\", version, cpuarch, version, cpuarch), Done: true}\n\t\t\t}\n\t\t\tstatus <- Status{Err: fmt.Errorf(\"Version not installed. Run \\\"nvm ls\\\" to see available versions.\"), Done: true}\n\t\t}\n\n\t\t// Remove symlink if it already exists\n\t\tsym, _ := os.Lstat(env.symlink)\n\t\tif sym != nil {\n\t\t\terr = validSymlink(env.symlink)\n\t\t\tif err != nil {\n\t\t\t\tstatus <- Status{Err: err, Done: true}\n\t\t\t}\n\n\t\t\t// _, err := runElevated(fmt.Sprintf(`\"%s\" cmd /C rmdir \"%s\"`, filepath.Join(env.root, \"elevate.cmd\"), filepath.Clean(env.symlink)))\n\t\t\t_, err := elevatedRun(\"rmdir\", filepath.Clean(env.symlink))\n\t\t\tif err != nil {\n\t\t\t\tif accessDenied(err) {\n\t\t\t\t\tstatus <- Status{Err: err, Done: true}\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":1156,"sourceCodeEnd":1192,"githubUrl":"https://github.com/coreybutler/nvm-windows/blob/5b18223ca19ff50d707f35410dbc6bd440a9f74d/src/nvm.go#L1156-L1192","documentation":"Generic terminal error emitted by `nvm use` when the requested version+arch is not installed and no cross-architecture suggestion applies. It directs the user to `nvm ls` to see what is available. Note the source sends this Status after the arch-hint Status without returning, so both messages can be emitted for the same failure.","triggerScenarios":"`nvm use 18.0.0` (or with any arch) where v18.0.0 is not present under the NVM root (env.root) for either 32- or 64-bit, i.e. IsVersionInstalled is false for the requested arch and the opposite arch too.","commonSituations":"Typo in the version string (e.g. `nvm use 18.0` vs installed `18.0.0`), fresh machine where versions were never installed, NVM_HOME/NVM_SYMLINK pointing at an empty or wrong directory, or a partially deleted version directory after a failed uninstall.","solutions":["Run `nvm ls` and use an exact version that is listed as installed","Install the version first: `nvm install <version>` then `nvm use <version>`","Verify NVM_HOME points to the directory that actually contains the v<version> folders","If the version folder exists but is corrupt, remove it (`nvm uninstall <version>`) and reinstall"],"exampleFix":"# before\nnvm use 21.6.1\n\n# after\nnvm ls              # confirm availability\nnvm install 21.6.1\nnvm use 21.6.1","handlingStrategy":"validation","validationCode":"versions, _ := node.GetInstalled(env.root)\nfound := false\nfor _, v := range versions {\n    if strings.HasPrefix(v, \"v\"+requested) { found = true }\n}\nif !found {\n    // install before use\n    _ = exec.Command(\"nvm\", \"install\", requested).Run()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Script `nvm install X && nvm use X` as one unit so use never runs against a missing version","Pin exact versions (x.y.z) in .nvmrc or scripts instead of prefixes","Verify NVM_HOME points at the directory containing the v* folders"],"tags":["nvm-windows","node","version-management","cli"],"backgroundTag":null,"analyzedSha":"5b18223ca19ff50d707f35410dbc6bd440a9f74d","analyzedAt":"2026-08-15T10:06:51.428Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}