[fatedier/frp]osx 上 make失败

2024-06-27 655 views
6
  • platform: osx
  • go version :1.6
  • $GOPATH : ~/go/
  • $GOROOT: ~/go/

在项目目录执行make报错

  go fmt ./src/...
go build -o bin/frps ./src/cmd/frps
src/cmd/frps/main.go:27:2: cannot find package "github.com/docopt/docopt-go" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/docopt/docopt-go (from $GOROOT)
    /Users/quanwei/go/src/github.com/docopt/docopt-go (from $GOPATH)
src/cmd/frps/main.go:29:2: cannot find package "github.com/fatedier/frp/src/assets" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/assets (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/assets (from $GOPATH)
src/cmd/frps/control.go:23:2: cannot find package "github.com/fatedier/frp/src/models/consts" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/models/consts (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/models/consts (from $GOPATH)
src/cmd/frps/control.go:24:2: cannot find package "github.com/fatedier/frp/src/models/metric" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/models/metric (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/models/metric (from $GOPATH)
src/cmd/frps/control.go:25:2: cannot find package "github.com/fatedier/frp/src/models/msg" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/models/msg (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/models/msg (from $GOPATH)
src/cmd/frps/control.go:26:2: cannot find package "github.com/fatedier/frp/src/models/server" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/models/server (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/models/server (from $GOPATH)
src/cmd/frps/control.go:27:2: cannot find package "github.com/fatedier/frp/src/utils/conn" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/utils/conn (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/utils/conn (from $GOPATH)
src/cmd/frps/control.go:28:2: cannot find package "github.com/fatedier/frp/src/utils/log" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/utils/log (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/utils/log (from $GOPATH)
src/cmd/frps/control.go:29:2: cannot find package "github.com/fatedier/frp/src/utils/pcrypto" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/utils/pcrypto (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/utils/pcrypto (from $GOPATH)
src/cmd/frps/main.go:33:2: cannot find package "github.com/fatedier/frp/src/utils/version" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/utils/version (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/utils/version (from $GOPATH)
src/cmd/frps/main.go:34:2: cannot find package "github.com/fatedier/frp/src/utils/vhost" in any of:
    /usr/local/Cellar/go16/1.6.3/libexec/src/github.com/fatedier/frp/src/utils/vhost (from $GOROOT)
    /Users/quanwei/go/src/github.com/fatedier/frp/src/utils/vhost (from $GOPATH)
make: *** [frps] Error 1

不懂go,一开始以为是go版本问题装了个go1.6结果还是这种错误

回答

0

切到v0.7.0到正常编译,v0.8.0,v0.8.1 都失败

3

Go 的项目放到 $GOPATH 下,建议你通过 go get github.com/fatedier/frp 下载源码。之后执行

cd $GOPATH/src/github.com/fatedier/frp && make

0

Thanks 可以了 :)