air
air copied to clipboard
no such file or directory even with `go/bin`
Hello when I try to run air on my project I got the no such file or directory
even though I have exported the go/bin directory
here's the list of my PATH Variables
echo -e ${PATH//:/\\n}
/Users/gagahgk/go/bin
/Users/gagahgk/google-cloud-sdk/bin
/Users/gagahgk/Library/Python/3.8/bin
/Users/gagahgk/.nvm/versions/node/v12.22.8/bin
/opt/local/bin
/opt/local/sbin
/Applications/Sublime Text.app/Contents/SharedSupport/bin
/opt/homebrew/bin
/opt/homebrew/sbin
/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Library/Apple/usr/bin
/Users/gagahgk/.fig/bin
/Users/gagahgk/.local/bin
and this is the full logs after running air
__ _ ___
/ /\ | | | |_)
/_/--\ |_| |_| \_ 1.42.0, built with Go 1.20.1
watching .
watching db
watching db/mocks
watching entity
watching entity/auth
building...
running...
/bin/sh: /Users/gagahgk/Documents/Git: No such file or directory
facing the same problem. Go's bin already in the PATH, but air not in go/bin directory after go install github.com/cosmtrek/air@latest
Found the solution.
With the command go install github.com/cosmtrek/air@latest
, the binary is getting installed in the home folder: ~/go/bin
. Then simply adding the alias: alias air='~/go/bin/air'
in the ~/.profile
and sourcing it with source ~/.profile
does the job for me.
what's your project's full path?
I facing the same problem, but I solve it.
In my case, system is Mac OS, my project's path has whitespace such like /Users/sal/Documents/code it/hello-go
.
When I copy my project to path /Users/sal/Documents/study/hello-go
, air command is ok.