如何修复&x201C;意外的目录布局”;安装go ethereum时出错?

如何修复&x201C;意外的目录布局”;安装go ethereum时出错?,ethereum,go-ethereum,swarm,Ethereum,Go Ethereum,Swarm,好吧,我希望这个问题属于这里 我正在学习区块极客教程,试图为以太坊区块链开发设置环境。我基本上已经到了最后一步,安装swarm,但我收到了一个错误,似乎与github上的文件夹结构有关。我该如何解决这个问题 便利信息: -操作系统:Windows 10,在cygwin中运行此项目,并安装了正确的gcc依赖项 -Go版本:1.11.4 几天来我一直试图找到一个解决方案,但我发现什么都不管用。感谢您的帮助 基本上,每个人都说这些步骤对他们有用: 也许是cygwin的事 尝试此命令时:$go inst

好吧,我希望这个问题属于这里

我正在学习区块极客教程,试图为以太坊区块链开发设置环境。我基本上已经到了最后一步,安装swarm,但我收到了一个错误,似乎与github上的文件夹结构有关。我该如何解决这个问题

便利信息:

-操作系统:Windows 10,在cygwin中运行此项目,并安装了正确的gcc依赖项

-Go版本:1.11.4

几天来我一直试图找到一个解决方案,但我发现什么都不管用。感谢您的帮助

基本上,每个人都说这些步骤对他们有用:

也许是cygwin的事

尝试此命令时:
$go install-v./cmd/swarm

我希望它能够正确安装,但我遇到以下错误:

unexpected directory layout:
        import path: github.com/naoina/toml
        root: C:\cygwin64\home\di203179\go\src
        dir: C:\cygwin64\home\di203179\go\src\github.com\ethereum\go-ethereum\vendor\github.com\naoina\toml
        expand root: C:\cygwin64\home\di203179\go\src
        expand dir: C:\cygwin64\home\di203179\go\src\github.com\ethereum\go-ethereum\vendor\github.com\naoina\toml
        separator: \
感谢您的帮助

更新

我想我在这里找到了引发此错误的代码:

下面是片段:

// dirAndRoot returns the source directory and workspace root
// for the package p, guaranteeing that root is a path prefix of dir.
func dirAndRoot(p *Package) (dir, root string) {
    dir = filepath.Clean(p.Dir)
    root = filepath.Join(p.Root, "src")
    if !str.HasFilePathPrefix(dir, root) || p.ImportPath != "command-line-arguments" && filepath.Join(root, p.ImportPath) != dir {
        // Look for symlinks before reporting error.
        dir = expandPath(dir)
        root = expandPath(root)
    }

    if !str.HasFilePathPrefix(dir, root) || len(dir) <= len(root) || dir[len(root)] != filepath.Separator || p.ImportPath != "command-line-arguments" && !p.Internal.Local && filepath.Join(root, p.ImportPath) != dir {
        base.Fatalf("unexpected directory layout:\n"+
            "   import path: %s\n"+
            "   root: %s\n"+
            "   dir: %s\n"+
            "   expand root: %s\n"+
            "   expand dir: %s\n"+
            "   separator: %s",
            p.ImportPath,
            filepath.Join(p.Root, "src"),
            filepath.Clean(p.Dir),
            root,
            dir,
            string(filepath.Separator))
    }

    return dir, root
}
//dirAndRoot返回源目录和工作区根目录
//对于包p,保证root是dir的路径前缀。
func dirAndRoot(p*包)(dir,根字符串){
dir=filepath.Clean(p.dir)
root=filepath.Join(p.root,“src”)
如果!str.HasFilePathPrefix(dir,root)| | p.ImportPath!=“命令行参数”&&filepath.Join(root,p.ImportPath)!=dir{
//在报告错误之前查找符号链接。
dir=expandPath(dir)
根=扩展路径(根)
}

if!str.HasFilePathPrefix(dir,root)| | len(dir)但是如果你构建了
geth
?就像在
go install-v./cmd/geth
中一样,它是有效的。但这不是同一个错误。不幸的是,在这一点上,我不记得错误是什么,但我最终通过npm安装了geth。如果你在
geth
中也遇到了类似的错误,我相信问题出在你的golang设置上,而不是go ethereum软件。@你可能是对的。我认为这与我工作地点的设置有关。考虑到所有的防火墙和复杂的路由、复杂的权限策略和共享驱动器,我认为我要么安装了一些不正确的东西,要么就是无法访问必要的URL…谢谢你的帮助。当我发现我想我会发布一个答案。所以我一直无法确定问题的根源。我的公司给了我访问geth安装程序所需的url的权限,并使用它解决了我的问题。