Beego安装错误解决(mac)


/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了


运行项目错误解决

/usr/local/gopath/src/golang.org/x/crypto/acme/autocert (from $GOPATH)

2020/07/17 09:20:13 ERROR ▶ 0003 Failed to build the application: …/github.com/astaxie/beego/staticfile.go:31:2: cannot find package “github.com/hashicorp/golang-lru” in any of:

解决方法:

go mod init

初始化一个go.mod文件到当前目录
https://www.cnblogs.com/dhcn/p/11321376.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值