我无法将github存储库添加到Julia

我无法将github存储库添加到Julia,julia,package-managers,Julia,Package Managers,下面我将学习Julia,其想法是向Julia添加Github存储库: pkg>addhttps://github.com/BenLauwens/ThinkJulia.jl 不幸的是,它输出了一个长错误: (v1.1) pkg> add https://github.com/BenLauwens/ThinkJulia.jl Updating git-repo `https://github.com/BenLauwens/ThinkJulia.jl` ERROR: GitError(Cod

下面我将学习Julia,其想法是向Julia添加Github存储库:

pkg>addhttps://github.com/BenLauwens/ThinkJulia.jl

不幸的是,它输出了一个长错误:

(v1.1) pkg> add https://github.com/BenLauwens/ThinkJulia.jl
  Updating git-repo `https://github.com/BenLauwens/ThinkJulia.jl`
ERROR: GitError(Code:ERROR, Class:Config, failed to map '--help')
Stacktrace:
 [1] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/LibGit2/src/error.jl:101 [inlined]
 [2] #checkout_tree#46(::LibGit2.CheckoutOptions, ::Function, ::LibGit2.GitRepo, ::LibGit2.GitTree) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/LibGit2/src/repository.jl:358
 [3] #checkout_tree at ./none:0 [inlined]
 [4] macro expansion at ./gcutils.jl:87 [inlined]
 [5] (::getfield(Pkg.Types, Symbol("##62#63")))(::LibGit2.GitTree) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:780
 [6] with(::getfield(Pkg.Types, Symbol("##62#63")), ::LibGit2.GitTree) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/LibGit2/src/types.jl:1125
 [7] #handle_repos_add!#61(::Bool, ::Nothing, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:760
 [8] #handle_repos_add! at ./none:0 [inlined]
 [9] #add_or_develop#17(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:47
 [10] (::getfield(Pkg.API, Symbol("#kw##add_or_develop")))(::NamedTuple{(:mode,),Tuple{Symbol}}, ::typeof(Pkg.API.add_or_develop), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at ./none:0
 [11] do_add!(::Dict{Symbol,Any}, ::Array{Pkg.Types.PackageSpec,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:672
 [12] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:742
 [13] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:741
 [14] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:563
 [15] #do_cmd#31(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:538
 [16] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:534 [inlined]
 [17] (::getfield(Pkg.REPLMode, Symbol("##53#56")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/REPLMode.jl:988
 [18] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [19] invokelatest at ./essentials.jl:741 [inlined]
 [20] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/LineEdit.jl:2273
 [21] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:1035
 [22] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:192
 [23] (::getfield(Base, Symbol("##734#736")){Bool,Bool,Bool,Bool})(::Module) at ./client.jl:362
 [24] #invokelatest#1 at ./essentials.jl:742 [inlined]
 [25] invokelatest at ./essentials.jl:741 [inlined]
 [26] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:346
 [27] exec_options(::Base.JLOptions) at ./client.jl:284
 [28] _start() at ./client.jl:436

我不明白为什么会出现这个错误,所以我想知道解决这个问题的方法。顺便说一下,我使用的是Julia 1.1,我使用的是Ubuntu 16.04 LTS。

您的系统中安装了
git
?你正在运行哪个操作系统?看看如何为不同的操作系统安装它

试着运行命令
Pkg.Status()
,看看有没有什么有意义的东西。如果您这样做,我建议您也检查一下位置
JULIA_PKGDIR
,并删除您试图安装的整个文件夹/git repo

作为最后一个选项,您可以创建新的Julia home。为此:

  • 备份当前主文件夹
  • 删除julia home(
    .julia
    在基于Unix的系统中)
  • 运行
    Pkg.init
  • 将旧的
    REQUIRE
    文件复制到新家
  • 运行
    Pkg.update
  • 根据需要将旧包复制到新家

  • 祝你好运

    好,所以问题与使用
    git
    的某些配置有关。如果您尝试:

    git克隆https://github.com/JuliaRegistries/General.git

    它显示了一个错误:

    Clonando en 'General'...
    fatal: mal valor de config numérica '--help' para 'core.autocrlf': unidad inválida
    
    也就是说:

    Cloning 'General'
    fatal: bad numeric config value 'auto' for 'core.autocrlf
    
    接下来,我在终端上写下:

    git config--global--replace all core.autocrlf false


    问题解决了。现在我可以向Julia添加存储库和包。

    我有
    git
    2.22.1。顺便问一下,你确定你的说明是针对Julia 1.1的吗
    Pkg.init
    在Julia 1.1中不起作用,
    Julia_PKGDIR
    在Julia 1.1中不是一个东西,命令应该是
    Pkg.status()
    。无论如何我已经按照您的指示进行了操作,但仍然存在问题。您正在运行哪个操作系统?尝试
    Pkg.update()
    。你得到了什么?我有Ubuntu 16.04,在Pkg.update()之后,我得到:
    将默认注册表克隆到`~/.julia`从中克隆注册表“https://github.com/JuliaRegistries/General.git“错误:无法从中克隆https://github.com/JuliaRegistries/General.git,错误:gitrerror(代码:错误,类:Config,映射'--help'失败)
    如果尝试git clone会发生什么https://github.com/JuliaRegistries/General.git从命令行?现在我了解了我的问题,它与
    git
    有关。我添加了我的答案以说明原因。如果您将我的答案标记为有帮助,我将不胜感激,因为我在您的
    git
    :)Ta中找到了问题