air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.35k stars 771 forks source link

Air not being installed in zsh path on macOS #558

Closed omicron1100 closed 1 month ago

omicron1100 commented 3 months ago

Followed instructions to install Air via go install using zsh on macOS but it gives the error zsh: command is not found: air. Tried to follow the commands under Q&A but it didn't work for me. I am not sure if I'm doing it correctly.

NeoEvaX commented 3 months ago

Went through this today. Make sure to add: export PATH=$PATH:$HOME/go/bin to your .zshrc file. Then reload your terminal.

This seems to be the destination of go install files.

adiguno commented 3 months ago

This worked for me. Edit your .zshrc file:

# hot reload for go servers using air
path+=('~/go/bin')
alias air='~/go/bin/.air'
DeniesKresna commented 3 months ago

in my case, ".air" is not exist in go/bin instead "air" without dot. just update above code to use alias air='~/go/bin/air' then its works for me.

Alisalmasi commented 3 months ago

in my case, ".air" is not exist in go/bin instead "air" without dot. just update above code to use alias air='~/go/bin/air' then its works for me.

this worked for me , thanks.

Kies8 commented 1 month ago

in my case, ".air" is not exist in go/bin instead "air" without dot. just update above code to use alias air='~/go/bin/air' then its works for me.

this works also for me (macOS M1)

xiantang commented 1 month ago

https://github.com/cosmtrek/air?tab=readme-ov-file#command-not-found-air-or-no-such-file-or-directory

ADTC commented 1 month ago

Rather than adding an alias, I would reckon this is the more proper solution: export PATH=$PATH:$HOME/go/bin

Because in the future when you add other tools using go install, they would automatically benefit from it as well.

I'd suggest adding this information in the "Via go install (Recommended)" section itself, as it's currently buried in Q&A only, way below.