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

zsh: command not found: air #135

Closed
scratchoo opened this issue Jan 15, 2021 · 11 comments
Closed

zsh: command not found: air #135

scratchoo opened this issue Jan 15, 2021 · 11 comments

Comments

@scratchoo
Copy link

scratchoo commented Jan 15, 2021

tried to installed air using both

go get -u github.com/cosmtrek/air

and

curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

then added alias air='~/.air' to .zshrc file
sourced the .zshrc (even restarted the terminal)

then run air -c .air.toml

zsh: no such file or directory: /home/mee/.air

system: ubuntu 18.04

@shadwan
Copy link

shadwan commented Jan 16, 2021

same issue, on m1 mac

@rizalgowandy
Copy link

rizalgowandy commented Jan 17, 2021

That's to be expected.
Executing curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b .
Binary will be $(go env GOPATH)/bin/air.
Meanwhile, your alias is pointing to ~/.air.
The binary isn't there.

Your choices:

  1. Update your alias to alias air='$(go env GOPATH)/bin/air'
  2. Move the binary to your home directory. mv $(go env GOPATH)/bin/air ~/.air

@nleroy917
Copy link

What @rizalgowandy said ^

My binary got installed in /Users/your-username/go/bin/air

@tedoham
Copy link

tedoham commented Feb 22, 2021

That's to be expected.
Executing curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b .
Binary will be $(go env GOPATH)/bin/air.
Meanwhile, your alias is pointing to ~/.air.
The binary isn't there.

Your choices:

  1. Update your alias to alias air='$(go env GOPATH)/bin/.air'
  2. Move the binary to your home directory. mv $(go env GOPATH)/bin/.air ~/.air

It works for me after I removed "." -> alias air='$(go env GOPATH)/bin/air'

@Petercopter
Copy link

Go noob here, same problem. I installed both using the installer, and also with go get while I was thrashing around. I wanted to keep it under version control, so I deleted the installed version and went with the go get method. It looks like

alias air='$(go env GOPATH)/bin/air'

Works for either one?

@xiantang
Copy link
Collaborator

xiantang commented Jul 4, 2021

That's to be expected.
Executing curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b .
Binary will be $(go env GOPATH)/bin/air.
Meanwhile, your alias is pointing to ~/.air.
The binary isn't there.

Your choices:

  1. Update your alias to alias air='$(go env GOPATH)/bin/air'
  2. Move the binary to your home directory. mv $(go env GOPATH)/bin/air ~/.air

this one is the solution. close...

@xiantang xiantang closed this as completed Jul 4, 2021
@JVmano
Copy link

JVmano commented Mar 8, 2022

That's to be expected. Executing curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b . Binary will be $(go env GOPATH)/bin/air. Meanwhile, your alias is pointing to ~/.air. The binary isn't there.

Your choices:

  1. Update your alias to alias air='$(go env GOPATH)/bin/air'
  2. Move the binary to your home directory. mv $(go env GOPATH)/bin/air ~/.air

That's to be expected.
Executing curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b .
Binary will be $(go env GOPATH)/bin/air.
Meanwhile, your alias is pointing to ~/.air.
The binary isn't there.
Your choices:

  1. Update your alias to alias air='$(go env GOPATH)/bin/.air'
  2. Move the binary to your home directory. mv $(go env GOPATH)/bin/.air ~/.air

It works for me after I removed "." -> alias air='$(go env GOPATH)/bin/air'

Nice! Inserting this alias in bashrc or zshrc makes any terminal session definitive for those who don't already know

@gabr0236
Copy link

This works for me. But every time i close/reopen i need to set the alias. Is there a more permanent option?

@JVmano
Copy link

JVmano commented Jan 18, 2023

@gabr0236 Check if there's any other path to your bashrc/zshrc. As always the default path is in ~/.

Some of those topics can be useful:
https://askubuntu.com/questions/160789/aliases-dont-work-after-restart-terminal
https://stackoverflow.com/questions/53270978/bash-alias-disappears-when-opening-new-terminal

diy0663 added a commit to diy0663/gohub that referenced this issue Feb 10, 2023
@rymesaint
Copy link

Go noob here, same problem. I installed both using the installer, and also with go get while I was thrashing around. I wanted to keep it under version control, so I deleted the installed version and went with the go get method. It looks like

alias air='$(go env GOPATH)/bin/air'

Works for either one?

This need to be updated on doc

@dhiashalabi
Copy link

tried to installed air using both

go get -u github.com/cosmtrek/air

and

curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

then added alias air='~/.air' to .zshrc file sourced the .zshrc (even restarted the terminal)

then run air -c .air.toml

zsh: no such file or directory: /home/mee/.air

system: ubuntu 18.04

You will need to update your ~/.zshrc file by adding this line:
export PATH=$PATH:$(go env GOPATH)/bin

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