记录今天安装Beego和Bee遇到了一些Bug和解决方案
1、go的版本不够,在github官网上可以看到
go的版本必须大于1.13
2、在控制命令行输入go get github.com/astaxie/beego后报出如下错误
go get: module github.com/beego/bee: Get "https://proxy.golang.org/github.com/beego/bee/@v/list": dial tcp 142.251.42.241:443: connectex: A connection attempt
failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
是因为没有设置代理访问速度受限因此报错
执行如下命令设置代理地址之后在执行即可
go env -w GOPROXY=https://goproxy.cn
3、安装Bee
命令 : go get -u github.com/beego/bee/v2
4、配置环境变量
将GOPROJECT目录下的bin文件添加到系统的Path环境变量中即可
完成之后即可输入Bee的命令来操作了
bee version : 查看版本
bee new '自定义名称' :创建一个自定义名称的Beego项目
bee run :运行Beego项目