命令”go”没有设置版本。

huangapple go评论82阅读模式
英文:

No version set for command go

问题

我尝试在Ubuntu机器上使用go version命令来检查我的go可执行文件的版本,但是我遇到了以下错误:

No version set for command go
Consider adding one of the following versions in your config file at 
golang 1.16.8
golang 1.17.1

我该如何解决这个问题?我没有之前的配置文件经验,我在谷歌上搜索了一下,但是没有找到可以解决这个问题的方法。

英文:

I attempted to check the version of my go executable with go version on an Ubuntu machine, however I got the following error:

No version set for command go
Consider adding one of the following versions in your config file at 
golang 1.16.8
golang 1.17.1

How do I resolve this? I have no prior experience with config file, I searched on google but I found nothing which could solve this issue.

答案1

得分: 4

这似乎是来自asdf-vm/asdf的错误消息,它是一个使用单个CLI工具管理多个运行时版本的工具,可以通过插件进行扩展。
你可以在asdf-vm/asdf问题838中看到该错误消息。

配置文件应该位于$HOME/.tool-versions中。

要解决这个问题,可以参考这个示例

asdf plugin add go
asdf install go latest
英文:

That seems to be an error message from asdf-vm/asdf, a tool which manages multiple runtime versions with a single CLI tool, extendable via plugins.
You can see that error message in asdf-vm/asdf issue 838.

The config file should be in $HOME/.tool-versions

To resolve this, as in this example:

asdf plugin add go
asdf install go latest

huangapple
  • 本文由 发表于 2022年3月2日 15:55:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/71319166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定