You need to enable JavaScript to run this app. Windows 10 环境下 Rebar3 无法拉取 Hex 依赖的问题求助
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10 环境下 Rebar3 无法拉取 Hex 依赖的问题求助

Rebar3 编译阶段拉取Hex依赖失败问题

当前开发环境

Erlang/OTP 23
Rebar 3.15.1,运行于Erlang/OTP 23、Erts 11.2环境

问题触发过程

参照Rebar3官方基础用法页面指引添加cowboy依赖,执行编译操作时流程中断,报错输出如下:

❯ rebar3 compile
===> Verifying dependencies...
===> Fetching cowboy v1.0.1
===> Failed to fetch and copy dep: {pkg,<<"cowboy">>,<<"1.0.1">>,
                               <<"810EFE0B51CBBB97B175E605A520963452990B6568F93306B4FE88955D40FE94">>,
                               <<"CF7F0969870EBAA68F6E176A1A9559BEC23FBB4B61988C9DECD7DF38D827C5A9">>,
                               #{api_key => undefined,
                                 api_organization => undefined,
                                 api_url => <<"https://hex.pm/api">>,
                                 http_adapter =>
                                  {r3_hex_http_httpc,#{profile => rebar}},
                                 http_etag => undefined,http_headers => #{},
                                 http_user_agent_fragment =>
                                  <<"(rebar3/3.15.1) (httpc)">>,
                                 name => <<"hexpm">>,repo_key => undefined,
                                 repo_organization => undefined,
                                 repo_public_key =>
                                  <<"-----BEGIN PUBLIC KEY-----
PUBLICK-KEY-HERE
-----END PUBLIC KEY-----">>,
                                 repo_verify => true,
                                 repo_verify_origin => true,
                                 tarball_max_size => 8388608,
                                 tarball_max_uncompressed_size => 67108864}}

排查相关参考信息

Rebar3 环境报告

执行rebar3 report compile生成的环境信息如下:

❯ rebar3 report compile
Rebar3 report
 version 3.15.1
 generated at 2021-04-28T02:55:18+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)  
-----------------
Task: compile
Entered as:
  compile
-----------------
Operating System: win32
ERTS: Erlang/OTP 23 [erts-11.2] [source] [smp:8:8] [ds:8:8:10] [async-threads:1]
Root Directory: c:/Program Files (x86)/erl-23.3
Library directory: c:/Program Files (x86)/erl-23.3/lib
-----------------
Loaded Applications:
bbmustache: 1.10.0
certifi: 2.5.3
cf: 0.3.1
common_test: 1.20
compiler: 7.6.7
crypto: 4.9
cth_readable: 1.5.1
dialyzer: 4.3.1
edoc: 0.12
erlware_commons: 1.4.0
eunit: 2.6
eunit_formatters: 0.5.0
getopt: 1.0.1
hipe: 4.0.1
inets: 7.3.2
kernel: 7.3
providers: 1.8.1
public_key: 1.10
relx: 4.4.0
sasl: 4.0.2
snmp: 5.8
ssl_verify_fun: 1.1.6
stdlib: 3.14.1
syntax_tools: 2.5
tools: 3.4.4

-----------------
Escript path: c:/tools/rebar3/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report repos shell state tar tree unlock update upgrade upgrade upgrade version xref

项目配置文件

当前rebar3.config配置内容:

{erl_opts, [debug_info]}.
{deps, [
  {cowboy, "1.0.1"}, % package
  {cowboy, {git, "git://github.com/ninenines/cowboy.git", {tag, "1.0.1"}}} % alternatively, source
]}.

{shell, [
  % {config, "config/sys.config"},
    {apps, [myapp]}
]}.

已验证现象

  • 从Hex源下载libp2p等其他依赖时,均出现相同的拉取失败错误

内容的提问来源于stack exchange,提问作者Harsh Gupta

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.23 02:24:03