air icon indicating copy to clipboard operation
air copied to clipboard

Air not being installed in zsh path on macOS

Open omicron1100 opened this issue 11 months ago • 5 comments

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.

omicron1100 avatar Mar 25 '24 03:03 omicron1100

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.

NeoEvaX avatar Mar 25 '24 04:03 NeoEvaX

This worked for me. Edit your .zshrc file:

# hot reload for go servers using air
path+=('~/go/bin')
alias air='~/go/bin/.air'

adiguno avatar Mar 25 '24 17:03 adiguno

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.

DeniesKresna avatar Mar 29 '24 11:03 DeniesKresna

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.

Alisalmasi avatar Mar 31 '24 18:03 Alisalmasi

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)

Kies8 avatar May 18 '24 08:05 Kies8

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

xiantang avatar May 24 '24 07:05 xiantang

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.

ADTC avatar May 30 '24 17:05 ADTC

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.

Worked for me

RadiBytes avatar Sep 25 '24 07:09 RadiBytes