Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no such file or directory even with go/bin #395

Open
GagahGK opened this issue Feb 27, 2023 · 3 comments
Open

no such file or directory even with go/bin #395

GagahGK opened this issue Feb 27, 2023 · 3 comments

Comments

@GagahGK
Copy link

GagahGK commented Feb 27, 2023

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
@GagahGK GagahGK changed the title no such file or directory no such file or directory even with go/bin Feb 27, 2023
@sarkarology
Copy link

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

@sarkarology
Copy link

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.

@zhenailuoye1
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants