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

前端 未结 12 1699
醉话见心
醉话见心 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条回答
  •  不思量自难忘°
    2020-12-12 12:19

    You need to setup both GOPATH and GOBIN. Make sure you have done the following (please replace ~/go with your preferred GOPATH and subsequently change GOBIN). This is tested on Ubuntu 16.04 LTS.

    export GOPATH=~/go 
    
    mkdir ~/go/bin
    
    export GOBIN=$GOPATH/bin
    

    The selected answer did not solve the problem for me.

提交回复
热议问题