无法安装套件

时间:2018-07-17 17:08:05

标签: go ethereum

最初将此内容发布在以太坊论坛上,但由于这里涉及Golang / git软件包安装问题,因此可能会对此问题有更多了解


我正在尝试使用以太坊客户端来编译智能合约。

我已经安装在我的PC上并安装了以下命令:

go get -u github.com/ethereum/go-ethereum 
cd $GOPATH/src/github.com/ethereum/go-ethereum/ 
make

一切正常。

我跑步时

make devtools

我收到以下错误:

Pros-MacBook-Pro:go-ethereum Santi$ make devtools
env GOBIN= go get -u golang.org/x/tools/cmd/stringer
# cd /Users/pro/go/src/golang.org/x/tools; git pull --ff-only
error: Your local changes to the following files would be overwritten by merge:
        CONTRIBUTING.md
        blog/blog.go
        cmd/godoc/autocert.go
        cmd/godoc/blog.go
        cmd/godoc/godoc_test.go
        cmd/godoc/handlers.go
        cmd/godoc/main.go
        cmd/godoc/x.go
        cmd/goimports/goimports.go
        cmd/gomvpkg/main.go
        cmd/goyacc/yacc.go
        cmd/guru/guru.go
        cmd/guru/guru_test.go
        cmd/guru/main.go
        cmd/guru/referrers.go
        cmd/guru/testdata/src/referrers/int_test.go
        cmd/guru/testdata/src/referrers/main.go
        cmd/guru/testdata/src/referrers/main.golden
        cmd/present/static/styles.css
        cmd/present/templates/slides.tmpl
        cmd/stringer/endtoend_test.go
        cmd/stringer/stringer.go
        cmd/tip/tip.go
        go/ast/astutil/imports.go
        go/ast/astutil/imports_test.go
        go/buildutil/allpackages_test.go
        go/buildutil/fakecontext.go
        go/buildutil/util_test.go
        go/gcexportdata/example_test.go
        go/gcexportdata/gcexportdata.go
        go/gcexportdata/main.go
        go/gcimporter15/bexport.go
        go/gcimporter15/bexport19_test.go
        go/gcimporter15/bexport_test.go
        go/gcimporter15/bimport.go
        go/gcimporter15/exportdata.go
        go/gcimporter15/gcimporter.go
        go/gcimporter15/gcimporter_test.go
        go/gcimporter15/isAlias18.go
        go/gcimporter15/isAlias19.go
        go/gcimporter15/testdata/a.go
        go/gcimporter15/testdata/b.go
        go/gcimporter15/testdata/exports.go
        go/gcimporter15/testdata/issue15920.go
        go/gcimporter15/testdata/issue20046.go
        go/gcimporter15/testdata/p.go
        go/gcimporter15/testdata/versions/test.go
        go/gcimporter15/testdata/versions/test_go1.7_0.a
        go/gcimporter15/testdata/versions/test_go1.7_1.a
        go/internal/gccgoimporter/gccgoinstallation_test.go
        go/internal/gccgoimporter/importer_test.go
        go/internal/gccgoimporter/parser.go
        go/loader/loader_test.go
        go/ssa/interp/external.go
        go/ssa/ssa.go
        go/vcs/vcs.go
        go/vcs/vcs_test.go
        godoc/cmdline.go
        godoc/cmdline_test.go
        godoc/dirtrees.go
        godoc/dl/dl.go
        godoc/godoc.go
        godoc/index.go
        godoc/pres.go
        godoc/server.go
        godoc/spec.go
        godoc/static/gen.go
        godoc/static/godoc.html
        godoc/static/godocs.js
        godoc/static/makestatic.go
        godoc/static/package.html
        godoc/static/playground.js
        godoc/static/static.go
        godoc/static/style.css
        godoc/template.go
        godoc/vfs/emptyvfs.go
        godoc/vfs/gatefs/gatefs.go
        godoc/vfs/mapfs/mapfs.go
        godoc/vfs/namespace.go
        godoc/vfs/os.go
        godoc/vfs/vfs.go
        godoc/vfs/zipfs/zipfs.go
        imports/fastwalk.go
        imports/fastwalk_dirent_fileno.go
        imports/fastwalk_dirent_ino.go
        imports/fastwalk_portable.go
        imports/fastwalk_test.go
        imports/fastwalk_unix.go
        imports/fix.go
        imports/fix_test.go
        imports/imports.go
        imports/sortimports.go
        present/parse.go
        refactor/eg/eg.go
        refactor/eg/eg_test.go
        refactor/eg/rewrite.go
        refactor/eg/testdata/no_after_return.template
        refactor/rename/rename.go
Please commit your changes or stash them before you merge.
Aborting
Updating 73e16cff..d74aaa1f
package golang.org/x/tools/cmd/stringer: exit status 1
make: *** [devtools] Error 1

希望这不是太严重,我尝试使用以下行创建go文件:

abigen -abi=Store.abi --pkg=store --out=Store.go
bash: abigen: command not found

我怀疑这与我的安装失败有关,并且希望对此有所指点

1 个答案:

答案 0 :(得分:0)

我能够通过以下操作解决此问题:

  • cd /Users/pro/go/src/golang.org/x/tools(这是存在问题的仓库)
  • 运行git stash save && git merge origin/master && git stash pop
  • 运行make devtools(make文件包含安装abigen并将其放置在usr/bin中的说明

我从这个答案中得到了帮助:

How do I ignore an error on 'git pull' about my local changes would be overwritten by merge?