Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go build 失败 #54

Closed
mdsf22 opened this issue Apr 28, 2019 · 2 comments
Closed

go build 失败 #54

mdsf22 opened this issue Apr 28, 2019 · 2 comments

Comments

@mdsf22
Copy link

mdsf22 commented Apr 28, 2019

go get -u github.com/bilibili/kratos/tool/kratos
cd $GOPATH/src
kratos new kratos-demo
cd $GOPATH/src/kratos-demo/cmd
go build

失败

../../github.com/bilibili/kratos/pkg/conf/paladin/toml.go:8:2: cannot find package "github.com/BurntSushi/toml" in any of:
	/usr/local/go/src/github.com/BurntSushi/toml (from $GOROOT)
	/root/go/src/github.com/BurntSushi/toml (from $GOPATH)
../../github.com/bilibili/kratos/pkg/conf/paladin/file.go:14:2: cannot find package "github.com/fsnotify/fsnotify" in any of:
	/usr/local/go/src/github.com/fsnotify/fsnotify (from $GOROOT)
	/root/go/src/github.com/fsnotify/fsnotify (from $GOPATH)
../../github.com/bilibili/kratos/pkg/database/sql/mysql.go:10:2: cannot find package "github.com/go-sql-driver/mysql" in any of:
	/usr/local/go/src/github.com/go-sql-driver/mysql (from $GOROOT)
	/root/go/src/github.com/go-sql-driver/mysql (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/http/blademaster/render/protobuf.go:6:2: cannot find package "github.com/gogo/protobuf/proto" in any of:
	/usr/local/go/src/github.com/gogo/protobuf/proto (from $GOROOT)
	/root/go/src/github.com/gogo/protobuf/proto (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/http/blademaster/render/render.pb.go:18:8: cannot find package "github.com/gogo/protobuf/types" in any of:
	/usr/local/go/src/github.com/gogo/protobuf/types (from $GOROOT)
	/root/go/src/github.com/gogo/protobuf/types (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/trace/proto/span.pb.go:6:8: cannot find package "github.com/golang/protobuf/proto" in any of:
	/usr/local/go/src/github.com/golang/protobuf/proto (from $GOROOT)
	/root/go/src/github.com/golang/protobuf/proto (from $GOPATH)
../../github.com/bilibili/kratos/pkg/ecode/status.go:9:2: cannot find package "github.com/golang/protobuf/ptypes" in any of:
	/usr/local/go/src/github.com/golang/protobuf/ptypes (from $GOROOT)
	/root/go/src/github.com/golang/protobuf/ptypes (from $GOPATH)
../../github.com/bilibili/kratos/pkg/ecode/types/status.pb.go:9:8: cannot find package "github.com/golang/protobuf/ptypes/any" in any of:
	/usr/local/go/src/github.com/golang/protobuf/ptypes/any (from $GOROOT)
	/root/go/src/github.com/golang/protobuf/ptypes/any (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/trace/proto/span.pb.go:9:8: cannot find package "github.com/golang/protobuf/ptypes/duration" in any of:
	/usr/local/go/src/github.com/golang/protobuf/ptypes/duration (from $GOROOT)
	/root/go/src/github.com/golang/protobuf/ptypes/duration (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/trace/proto/span.pb.go:10:8: cannot find package "github.com/golang/protobuf/ptypes/timestamp" in any of:
	/usr/local/go/src/github.com/golang/protobuf/ptypes/timestamp (from $GOROOT)
	/root/go/src/github.com/golang/protobuf/ptypes/timestamp (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/trace/config.go:9:2: cannot find package "github.com/pkg/errors" in any of:
	/usr/local/go/src/github.com/pkg/errors (from $GOROOT)
	/root/go/src/github.com/pkg/errors (from $GOPATH)
../../github.com/bilibili/kratos/pkg/stat/prom/prometheus.go:8:2: cannot find package "github.com/prometheus/client_golang/prometheus" in any of:
	/usr/local/go/src/github.com/prometheus/client_golang/prometheus (from $GOROOT)
	/root/go/src/github.com/prometheus/client_golang/prometheus (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/http/blademaster/prometheus.go:4:2: cannot find package "github.com/prometheus/client_golang/prometheus/promhttp" in any of:
	/usr/local/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOROOT)
	/root/go/src/github.com/prometheus/client_golang/prometheus/promhttp (from $GOPATH)
../../github.com/bilibili/kratos/pkg/net/trace/propagation.go:7:2: cannot find package "google.golang.org/grpc/metadata" in any of:
	/usr/local/go/src/google.golang.org/grpc/metadata (from $GOROOT)
	/root/go/src/google.golang.org/grpc/metadata (from $GOPATH)
../../github.com/bilibili/kratos/pkg/conf/dsn/dsn.go:8:2: cannot find package "gopkg.in/go-playground/validator.v9" in any of:
	/usr/local/go/src/gopkg.in/go-playground/validator.v9 (from $GOROOT)
	/root/go/src/gopkg.in/go-playground/validator.v9 (from $GOPATH)

go version 为1.12.4

@tonybase
Copy link
Member

应该是没启用gomod,可以export GO111MODULE=on启用一下试试

@Terry-Mao
Copy link
Member

@tonyboxes 在README更新下需要Requirements,go版本,go mod,protoc 等

@mdsf22 mdsf22 closed this as completed Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants