英文:
Command 'wails' not found in linux, Error installing wails Go
问题
我正在尝试在Ubuntu 22.04上安装wails
。
我的系统上已经安装了Go版本go1.20.3
和NPM版本6.14.11
。
我按照官方网站教程中的所有步骤进行操作。
上述教程中提到的步骤没有出现任何错误。
但是当我尝试以下命令时:
$ wails version
或者
$ wails doctor
我会收到以下错误信息:
$ Command 'wails' not found
英文:
I'm trying to install wails
in Ubuntu 22.04
.
Go version go1.20.3
and NPM version 6.14.11
are already installed on my system.
I followed all steps from the official website tutorial.
There have been no errors with the steps mentioned in above tutorial.
But when I try the following command
$ wails version
or
$ wails doctor
then I get the error
$ Command 'wails' not found
答案1
得分: 2
go已经安装在我的系统中
当我运行go version命令时,它能够正确运行
但是go安装的目录home/[用户名]/go/bin/没有添加到PATH环境变量中
我按照以下步骤将其添加到PATH环境变量中:
-
打开终端
-
打开
~/.bashrc
文件
$ nano ~/.bashrc
- 转到文件底部并添加以下行
$ export PATH=$PATH:/home/[用户名]/go/bin/
> 你应该使用go/bin文件夹的实际路径,即go安装的路径
>
> 不要忘记在末尾添加斜杠/
- 按下Ctrl + X退出nano编辑器,并输入**"Y"**保存更改。
- 最后运行以下命令
$ source ~/.bashrc
> PATH成功添加
现在当我运行wails version
命令时,不会再出现错误。
英文:
go is already installed in my system
when I run go version command it run correctly
but the directory where go installed that is home/[username]/go/bin/ was not added in PATH environment.
I followed these steps to add it in PATH environment:
-
Opened the terminal
-
Open the
~/.bashrc
file
$ nano ~/.bashrc
- Go to bottom of the file and add following line
$ export PATH=$PATH:/home/[username]/go/bin/
> you should use the actual path of go/bin folder where the go is installed
>
> don't forget to add / at the end
- Press Ctrl + X to exit nano editor, and type "Y" to save changes.
- Finally run the following command
$ source ~/.bashrc
> PATH is successfully added
Now when I run wails version
command it don't give me any error.
答案2
得分: 1
看起来像是一个环境变量的问题,请查看关于此问题的常见问题解答(https://wails.io/docs/guides/troubleshooting/#the-wails-command-appears-to-be-missing)。
将其添加到bashrc可能不足以解决您的问题,您应该在.profile
中设置您的环境变量。请查看这些回答,解释了用于设置环境变量的可用文件(https://serverfault.com/q/261802)。
英文:
It looks like an environement variable issue, take a look at the faq about that (https://wails.io/docs/guides/troubleshooting/#the-wails-command-appears-to-be-missing)
Adding it to bashrc may not be enough to fix your issue, You should probably set your environement variables in .profile
. Take a look at those awnsers explaining the avalible files used to set up environement varaibles https://serverfault.com/q/261802
答案3
得分: 1
按照以下命令操作:
export GOPATH=~/go
go install github.com/wailsapp/wails/v2/cmd/wails@latest
export PATH=$PATH:$(go env GOPATH)/bin
source ~/.bashrc
wails version
在终端中输入以下命令查看版本号:
wails version
输出结果应为:
v2.4.1
英文:
Follow These Commands
export GOPATH=~/go
go install github.com/wailsapp/wails/v2/cmd/wails@latest
export PATH=$PATH:$(go env GOPATH)/bin
source ~/.bashrc
wails version
devn@macbook-pro-2 ~ % wails version
v2.4.1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论