首页 > 解决方案 > OPAM 无法发布包 - 说 git 无法获取

问题描述

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

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

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 安装需要一些调整才能使其正常工作?

标签: gitopam

解决方案


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

/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 降级到 <4.3.0

opam install github-unix.4.2.0

再跑opam publish

参考


推荐阅读