duanfei8399 2018-07-17 17:08
浏览 79
已采纳

无法安装套件

Initially posted this on the Ethereum forum but feel that there might be more knowledge of the issue here as it is a Golang/git package installation issue


I am trying to compile smart contracts using the go-ethereum client.

I have go installed on my pc and installed ran the following commands:

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

Which all work fine.

When I run

make devtools

I get the following error:

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

Hoping that this wasnt too serious, I tries creating my go file with the following line:

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

I suspect this has to do with my failed install and will appreciate any pointers on this

  • 写回答

1条回答 默认 最新

  • duanliu6083 2018-07-18 12:38
    关注

    I was able to solve this by doing the following:

    • cd /Users/pro/go/src/golang.org/x/tools (This is the repo that had the issues)
    • Run git stash save && git merge origin/master && git stash pop
    • Run make devtools (The make file contains the instructions for installing abigen and placing it in usr/bin

    I got help from this answer:

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺