【问题标题】:OPAM fails to publish a package - says git failed to fetchOPAM 无法发布包 - 说 git 无法获取
【发布时间】:2020-04-28 09:36:10
【问题描述】:

我正在尝试使用此处的说明发布 opam 包: https://opam.ocaml.org/doc/Packaging.html

我确实创建了一个标签并将其推送到 github 上。 当我尝试使用 opam publish 在 opam 上发布它时,我收到以下错误消息:

Fetching the package repository, this may take a while...
[ERROR] Uncaught exception: "/usr/bin/git fetch --multiple origin user" exited with code 128 "fatal: No such remote or remote group:
        user"

我是否错误地设置了 git 存储库,或者我的 opam 安装需要一些调整才能使其正常工作?

【问题讨论】:

  • 显然它正试图从一个不存在的名为用户的 git 远程中提取。检查定义远程存储库的配置。或者尝试创建一个名为“用户”的新 git 远程。
  • @Mickael B. 我添加了一个名为“用户”的新遥控器。它没有用。

标签: git opam


【解决方案1】:

也许在你看到这个错误之前

/usr/bin/git fetch --multiple origin user" exited with code 128 "fatal: No such remote or remote group: user

您错过了 401 Unauthorized 错误,这与较新的 github-unix 包中的错误有关,导致 GitHub 弃用 API。

这是我清理它的方法。

清理剩余的 opam-publish 状态

rm -rf ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository
rm -f ~/.opam/plugins/opam-publish/ocaml%opam-repository.token

将 github-unix 降级到

opam install github-unix.4.2.0

再次运行opam publish

参考文献

【讨论】:

    【解决方案2】:

    我根据此处描述的问题找到了答案: https://github.com/ocaml/opam-publish/issues/92

    解决方法是删除文件夹: <opam root>/plugins/opam-publish/repos/ocaml%opam-repository

    可以使用命令opam config list 找到(在全局 opam 变量 部分中查找 root 变量)

    【讨论】:

      猜你喜欢
      • 2022-01-10
      • 1970-01-01
      • 2020-03-26
      • 2015-03-05
      • 1970-01-01
      • 2013-03-20
      • 1970-01-01
      • 1970-01-01
      • 2022-08-24
      相关资源
      最近更新 更多