当前位置: 首页 > 工具软件 > X.org Server > 使用案例 >

解决 cannot find package "golang.org/x/crypto/ripemd160" in any of:

楚俊迈
2023-12-01

报错信息:

./btcutil/address.go:18:2: cannot find package "golang.org/x/crypto/ripemd160" in any of:

        /usr/local/go/src/golang.org/x/crypto/ripemd160 (from $GOROOT)

        /root/go/src/golang.org/x/crypto/ripemd160 (from $GOPATH)

解决方式

cd $GOPATH/src/golang.org/x

如果没有 golang.org/x  则创建相关目录

执行

git clone https://github.com/golang/crypto.git


报错信息:

rpc/walletrpc/api.pb.go:68:2: cannot find package "golang.org/x/net/context" in any of:

        /usr/local/go/src/golang.org/x/net/context (from $GOROOT)

        /root/go/src/golang.org/x/net/context (from $GOPATH)

执行

cd $GOPATH/src/golang.org/x

git clone https://github.com/golang/net.git


报错信息:

rpc/walletrpc/api.pb.go:69:2: cannot find package "google.golang.org/grpc" in any of:

        /usr/local/go/src/google.golang.org/grpc (from $GOROOT)
        /root/go/src/google.golang.org/grpc (from $GOPATH)
rpc/rpcserver/server.go:26:2: cannot find package "google.golang.org/grpc/codes" in any of:
        /usr/local/go/src/google.golang.org/grpc/codes (from $GOROOT)
        /root/go/src/google.golang.org/grpc/codes (from $GOPATH)
rpcserver.go:24:2: cannot find package "google.golang.org/grpc/credentials" in any of:
        /usr/local/go/src/google.golang.org/grpc/credentials (from $GOROOT)

        /root/go/src/google.golang.org/grpc/credentials (from $GOPATH)

rpc/rpcserver/log.go:21:2: cannot find package "google.golang.org/grpc/grpclog" in any of:

        /usr/local/go/src/google.golang.org/grpc/grpclog (from $GOROOT)

        /root/go/src/google.golang.org/grpc/grpclog (from $GOPATH)

解决方式:

创建目录

mkdir -p $GOPATH/src/google.golang.org/

cd $GOPATH/src/google.golang.org/

git clone https://github.com/Agzs/grpc grpc

安装

cd $GOPATH/src/

go install google.golang.org/grpc


报错信息:

../../../golang.org/x/net/idna/idna.go:23:2: cannot find package "golang.org/x/text/secure/bidirule" in any of:
        /usr/local/go/src/golang.org/x/text/secure/bidirule (from $GOROOT)
        /root/go/src/golang.org/x/text/secure/bidirule (from $GOPATH)
../../../golang.org/x/net/idna/idna.go:24:2: cannot find package "golang.org/x/text/unicode/bidi" in any of:
        /usr/local/go/src/golang.org/x/text/unicode/bidi (from $GOROOT)
        /root/go/src/golang.org/x/text/unicode/bidi (from $GOPATH)
../../../golang.org/x/net/idna/idna.go:25:2: cannot find package "golang.org/x/text/unicode/norm" in any of:
        /usr/local/go/src/golang.org/x/text/unicode/norm (from $GOROOT)

        /root/go/src/golang.org/x/text/unicode/norm (from $GOPATH)

执行

cd $GOPATH/src/golang.org/x

git clone  https://github.com/golang/text.git



 类似资料: