JanDeDobbeleer/oh-my-posh · warning

NO VERSION

Error message

NO VERSION

What it means

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.

Source

Thrown at src/segments/language.go:434

		l.Executable = command.executable

		duration := l.options.String(options.CacheDuration, string(cache.NONE))
		cache.Device.Set(cacheKey, l.Version, cache.Duration(duration))

		return nil
	}

	if lastError != nil {
		return lastError
	}

	return errors.New(l.options.String(MissingCommandText, ""))
}

func (l *Language) runCommand(command *cmd) (string, error) {
	if command.getVersion == nil {
		if !l.env.HasCommand(command.executable) {
			return "", errors.New(noVersion)
		}

		cacheKey, cacheable := l.versionCacheKey(command)
		if cacheable {
			if cached, found := cache.Device.Get[string](cacheKey); found {
				log.Debugf("using cached version output for %s", command.executable)
				return cached, nil
			}
		}

		versionStr, err := l.env.RunCommandWithEnv(command.executable, command.envs, command.args...)

		if exitErr, ok := err.(*runtime.CommandError); ok {
			l.exitCode = exitErr.ExitCode
			return "", fmt.Errorf("err executing %s with %v", command.executable, command.args)
		}

		// Success only: a failed run (a non-CommandError err, or one the

View on GitHub (pinned to 0976794618)

Solutions

  1. Install the language runtime or make sure its binary is on the PATH used by the prompt shell.
  2. Initialize your version manager (e.g. add nvm/pyenv/asdf hooks) in the shell's profile so the executable resolves.
  3. Set the segment's `missing_command_text` option to control the fallback display, or disable the segment when the tool is absent.
  4. Use a different `executable` option if the tool is available under another name.
Defensive patterns

Strategy: validation

Validate before calling

command -v node >/dev/null 2>&1 || echo 'node not on PATH'

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/45f0d812e59dfc52. Report an issue: GitHub.