简体   繁体   English

Rebar3 无法下载对 Windows 10 的依赖

[英]Rebar3 is unable to download dependency on Windows 10

I am just starting with otp and rebar3.我只是从 otp 和 rebar3 开始。 Following are the versions installed:以下是安装的版本:

Erlang/OTP 23二郎/OTP 23

rebar 3.15.1 on Erlang/OTP 23 Erts 11.2 Erlang/OTP 23 Erts 11.2 上的钢筋 3.15.1

However, when I am trying to add the dependency cowboy from the Basic Usage page of rebar3, the compilation fails with the following error:但是,当我尝试从 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-----\nPUBLICK-KEY-HERE\n-----END PUBLIC KEY-----">>,
                                 repo_verify => true,
                                 repo_verify_origin => true,
                                 tarball_max_size => 8388608,
                                 tarball_max_uncompressed_size => 67108864}}

For convenience below is the rebar3 report which was generated using the command rebar3 report compile :为方便起见,下面是使用命令rebar3 report compile生成的 rebar3 报告:

❯ 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

my rebar3.config file:我的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]}
]}.

I have tried downloading a different dependency such as libp2p from hex but with same error.我尝试从十六进制下载不同的依赖项,例如libp2p ,但出现相同的错误。

Any help will be appreciated.任何帮助将不胜感激。 Thank you.谢谢你。

Try use:尝试使用:

{deps, [
  {cowboy, {git, "git://github.com/ninenines/cowboy.git", {tag, "1.0.1"}}}
]}.

or或者

{deps, [
  {cowboy, "1.0.1"}
]}.

don't try two different approaches to get dependencies at the same time.不要同时尝试两种不同的方法来获取依赖项。

PS The {cowboy, "1.0.1"} is too old version and may not supported in OTP 23 . PS {cowboy, "1.0.1"}版本太旧, OTP 23可能不支持。 Try use latest version 2.8.0 .尝试使用最新版本2.8.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM