0

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
Benjamin Buch
  • 4,752
  • 7
  • 28
  • 51

3 Answers3

2

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:

  1. Opened the terminal

  2. Open the ~/.bashrc file

$ nano ~/.bashrc
  1. 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

  1. Press Ctrl + X to exit nano editor, and type "Y" to save changes.
  2. 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.

wails version command output

hkanjih
  • 1,271
  • 1
  • 11
  • 29
1

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

Pierre Lezan
  • 120
  • 1
  • 10
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

farrukh raja
  • 187
  • 4