Skip to content

MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing) #4588

@ValentinKaisermayer

Description

@ValentinKaisermayer

Got this error as part of a docker build process using julia:1.11.4-bookworm

ERROR: MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)
57.25 The function `project_rel_path` exists, but no method is defined for this combination of argument types.
57.55
57.55 Closest candidates are:
57.55   project_rel_path(::Pkg.Types.EnvCache, !Matched::String)
57.55    @ Pkg /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/Operations.jl:956
57.56
57.56 Stacktrace:
57.56   [1] package_info(env::Pkg.Types.EnvCache, pkg::Pkg.Types.PackageSpec, entry::Pkg.Types.PackageEntry)
57.56     @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:66
57.56   [2] package_info
57.56     @ /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:59 [inlined]
57.56   [3] #9
57.56     @ ./none:0 [inlined]
57.56   [4] iterate
57.56     @ ./generator.jl:48 [inlined]
57.56   [5] Dict{Base.UUID, Pkg.API.PackageInfo}(kv::Base.Generator{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}})
57.67     @ Base ./dict.jl:95
57.67   [6] dict_with_eltype
57.67     @ ./abstractdict.jl:636 [inlined]
57.67   [7] dict_with_eltype
57.67     @ ./abstractdict.jl:643 [inlined]
57.67   [8] Dict
57.67     @ ./dict.jl:117 [inlined]
57.67   [9] dependencies
57.67     @ /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:86 [inlined]
57.67  [10] dependencies()
57.67     @ Pkg.API /usr/local/julia/share/julia/stdlib/v1.11/Pkg/src/API.jl:83

I fixed it by changing the relative path of a local dependency:

[sources]
TestModule = {path = "../deps/TestModule"}

instead of

[sources]
TestModule = {path = "..\\deps\\TestModule"}

However, since I am on Windows Julia shows me paths (e.g. in tab-complete), e.g. like this:

julia> include("App\\test\\run
App\\test\\run.jl
App\\test\\runtests.jl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions