{"record":{"id":"45f0d812e59dfc52","repo":"JanDeDobbeleer/oh-my-posh","slug":"no-version","errorCode":null,"errorMessage":"NO VERSION","messagePattern":"NO VERSION","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/segments/language.go","lineNumber":434,"sourceCode":"\t\tl.Executable = command.executable\n\n\t\tduration := l.options.String(options.CacheDuration, string(cache.NONE))\n\t\tcache.Device.Set(cacheKey, l.Version, cache.Duration(duration))\n\n\t\treturn nil\n\t}\n\n\tif lastError != nil {\n\t\treturn lastError\n\t}\n\n\treturn errors.New(l.options.String(MissingCommandText, \"\"))\n}\n\nfunc (l *Language) runCommand(command *cmd) (string, error) {\n\tif command.getVersion == nil {\n\t\tif !l.env.HasCommand(command.executable) {\n\t\t\treturn \"\", errors.New(noVersion)\n\t\t}\n\n\t\tcacheKey, cacheable := l.versionCacheKey(command)\n\t\tif cacheable {\n\t\t\tif cached, found := cache.Device.Get[string](cacheKey); found {\n\t\t\t\tlog.Debugf(\"using cached version output for %s\", command.executable)\n\t\t\t\treturn cached, nil\n\t\t\t}\n\t\t}\n\n\t\tversionStr, err := l.env.RunCommandWithEnv(command.executable, command.envs, command.args...)\n\n\t\tif exitErr, ok := err.(*runtime.CommandError); ok {\n\t\t\tl.exitCode = exitErr.ExitCode\n\t\t\treturn \"\", fmt.Errorf(\"err executing %s with %v\", command.executable, command.args)\n\t\t}\n\n\t\t// Success only: a failed run (a non-CommandError err, or one the","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/language.go#L416-L452","documentation":"The language segment's runCommand() returns the constant noVersion ('NO VERSION') when the configured executable is not found on PATH (only for commands without a custom getVersion function). This signals that the tool isn't installed or isn't reachable, so no version can be displayed.","triggerScenarios":"setVersion iterates over display commands and calls runCommand with an executable that l.env.HasCommand cannot find on PATH; also exercised in tests with mocked environments lacking the command.","commonSituations":"Segment enabled in theme but the language runtime isn't installed; version managers (nvm, pyenv, asdf) not initialized in the prompt's non-interactive shell so the binary isn't on PATH; Windows vs WSL path differences.","solutions":["Install the language runtime or make sure its binary is on the PATH used by the prompt shell.","Initialize your version manager (e.g. add nvm/pyenv/asdf hooks) in the shell's profile so the executable resolves.","Set the segment's `missing_command_text` option to control the fallback display, or disable the segment when the tool is absent.","Use a different `executable` option if the tool is available under another name."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"command -v node >/dev/null 2>&1 || echo 'node not on PATH'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure version-manager init (nvm/pyenv/asdf) runs in the prompt's shell profile.","Install the runtime before enabling its segment in your theme.","Set `missing_command_text` so the segment degrades gracefully.","Compare PATH in the prompt shell (`oh-my-posh debug`) with your interactive shell."],"tags":["path","command-not-found","language-segment"],"backgroundTag":"command-not-found","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}