Go install fails with error: no install location for directory xxx outside GOPATH

前端 未结 12 1698
醉话见心
醉话见心 2020-12-12 11:22
~/src/go-statsd-client> echo $GOPATH
/Users/me/gopath
~/src/go-statsd-client> echo $GOROOT
/usr/local/Cellar/go/1.1.1\\
~/src/go-statsd-client> go install
g         


        
12条回答
  •  Happy的楠姐
    2020-12-12 12:17

    On OSX Mojave 10.14, go is typically installed at /usr/local/go.

    Hence, setup these ENVs and you should be good to go.

    export GOPATH=/usr/local/go && export GOBIN=/usr/local/go/bin

    Also, add these to your bash_profile or zsh_profile if it works.

    echo "export GOPATH=/usr/local/go && export GOBIN=/usr/local/go/bin" >> ~/.bash_profile && source ~/.bash_profile

提交回复
热议问题