mac安装beego脚手架遇到的问题
1. 运行环境
- Mac
- Go 1.18.5
2. 问题描述?
go get github.com/beego/bee
使用go get安装bee时出现如下错误
go: go.mod file not found in current directory or any parent directory.
‘go get’ is no longer supported outside a module.
To build and install a command, use ‘go install’ with a version,
like ‘go install example.com/cmd@latest’
For more information, see golang.org/doc/go-get-install-depr...
or run ‘go help get’ or ‘go help install’.
克隆一个beego项目,在这个项目根目录安装脚手架
你好,有错误信息如上,先需要go mod init创建一个项目,然后才能安装。
试试 go install 代替 go get?
试一试先开启Go module? 再init?
' go get '在模块之外不再受支持。
要构建和安装一个命令,使用带有版本的“go install”,
比如“去安装example.com/cmd@latest”
欲了解更多信息,请参见golang.org/doc/go-get-install-depr…
或者运行' go help get '或' go help install '。
非常感谢@苏亦坤 @日出 ,目前问题已经解决
安装成功后,bee脚手架位置:$GO_PAATH/bin/bee 最后将GO_PATH 设置 path