【问题标题】:How can I fix dep ensure error 'cannot stat file' on Mac?如何在 Mac 上修复 dep 确保错误“无法统计文件”?
【发布时间】:2019-09-17 23:49:33
【问题描述】:

在大型项目上运行 dep ensure 时会失败并出现以下错误:

cannot Stat: stat <project>/vendor/github.com/prometheus/procfs/fixtures/self/fd/0: no such file or directory

我该如何解决这个问题?

【问题讨论】:

  • 正确的“修复”是不再使用 dep。
  • 我不得不这样做,同时在新的上游版本上重新调整分叉中的更改 - 它实际上不在我的控制之下。

标签: go dependencies vendor


【解决方案1】:

有known issues 和dep 0.5(此时最新)导致错误。目前还没有修复,但您可以降级到 0.4 以使一切正常。

您可以使用项目 repo 中的安装脚本,并通过环境变量指定所需的版本。

export DEP_RELEASE_TAG="v0.4.1"
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

【讨论】:

    猜你喜欢
    • 2018-04-16
    • 2019-12-08
    • 2012-10-29
    • 2018-02-10
    • 2021-01-14
    • 1970-01-01
    • 1970-01-01
    • 2019-09-14
    • 2011-01-26
    相关资源
    最近更新 更多