欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Beego安装错误解决(mac)

程序员文章站 2024-03-25 19:30:22
...


/Users/jiaqihu/go/src/github.com/gadelkareem/delve/service/rpccommon/server.go:83:3: cannot use logger (type *“github.com/go-delve/delve/vendor/github.com/sirupsen/logrus”.Entry) as type *“github.com/gadelkareem/delve/vendor/github.com/sirupsen/logrus”.Entry in field value
#github.com/gadelkareem/delve/service/debugger
/Users/jiaqihu/go/src/github.com/gadelkareem/delve/service/debugger/debugger.go:129:3: cannot use logger (type *“github.com/go-delve/delve/vendor/github.com/sirupsen/logrus”.Entry) as type *“github.com/gadelkareem/delve/vendor/github.com/sirupsen/logrus”.Entry in field value

错误1.没有配置GOPATH

/Users/jiaqihu/go/src/github.com/gadelkareem/delve/service/rpccommon/server.go:83:3: cannot use logger (type *“github.com/go-delve/delve/vendor/github.com/sirupsen/logrus”.Entry) as type *“github.com/gadelkareem/delve/vendor/github.com/sirupsen/logrus”.Entry in field value

export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=/usr/local/gopath

错误2.配置好GOPATH后,如出现如下错误,是因为GOPATH的文件夹没有建立,在/usr/local/下建立gopath路径的文件夹即可

package github.com/beego/bee: mkdir /usr/local/gopath: permission denied

错误3.没有配置GOPROXY及GO111MODULE的设置

/Users/jiaqihu/go/src/github.com/gadelkareem/delve/service/debugger/debugger.go:129:3: cannot use logger (type *“github.com/go-delve/delve/vendor/github.com/sirupsen/logrus”.Entry) as type *“github.com/gadelkareem/delve/vendor/github.com/sirupsen/logrus”.Entry in field value

// An highlighted block
go env -w GOPROXY=https://goproxy.io,direct
go env -w GO111MODULE=on

执行完毕后再次安装bee

go get -u github.com/beego/bee 

安装完毕输入bee

错误4.可能又报错了,zsh: command not found: bee,将bin目录下bee的路径拷贝添加到环境变量中

sudo vi ~/.bash_profile
export PATH=$PATH:/usr/local/gopath/bin
source .bash_profile 发布环境变量

再次输入bee就ok了

相关标签: go