No .air folder after installing with go install with Go 1.24.3
Following the README, it's impossible to launch air in a terminal. The readme refers to a ~/.air/ folder, whereas the command go install github.com/air-verse/air@latest creates a ~/go/ folder.
Same here, using Ubuntu 22.04.5 LTS with WSL.
Installed golang using .tar from go.dev rm -rf /usr/local/go && tar -C /usr/local -xzf go1.24.3.linux-amd64.tar.gz
Have this issue as well in linux 6.12.33-1-lts, but on Go version 1.24.4.
same here in macOS 15.5 go 1.24.4
✅ Fix: air command not found after go install or if air init is not working
If you're seeing this error when trying to use air:
air: command not found
even after installing it with:
go install github.com/cosmtrek/air@latest
👉 The problem is that Go installs binaries to your local $HOME/go/bin directory, but this path is not included in your system's PATH environment variable by default — especially on Linux systems like Ubuntu or Pop!_OS.
🛠️ Solution: Add $HOME/go/bin to your PATH
Update your shell config file to include the Go binaries directory.
For Bash (~/.bashrc)
export PATH="$HOME/go/bin:$PATH"
source ~/.bashrc
For Zsh (~/.zshrc)
export PATH="$HOME/go/bin:$PATH"
source ~/.zshrc
This tells your terminal where to find tools installed via go install.
After adding this above export path, my bash config e.g. .bashrc now has two export path, like this :
✅ Test it
Now open a new terminal or run:
source ~/.bashrc # or ~/.zshrc
Then check:
which air
Expected output:
/home/your-username/go/bin/air
Now you can successfully run these command in your project root to enjoy hot reload 💯
air init
air
📌 Notes
- This solution worked for me on Pop!_OS (Ubuntu-based), but applies to any Linux where
$HOME/go/binisn't inPATH. - This issue affects all Go tools installed via
go install, not justair.
Alhamdulillah, this fixed it for me. Posting here in case it helps someone else struggling with the same thing. 🙌