What is it about? I removed my ./Project.toml file just in case, then:
$ julia +1.11 --project=.
julia> using JSON
..
Resolving package versions...
ERROR: expected package `JuliaSyntaxHighlighting [dc6e5ff7]` to be registered
also when adding it directly:
pkg> add JuliaSyntaxHighlighting
Resolving package versions...
ERROR: expected package `JuliaSyntaxHighlighting [dc6e5ff7]` to be registered
I find old workaround (do not remove .julia, then at least move it):
I was able to solve this issue by deleting the registries folder within my .julia folder.
It likely works, but should such be needed? Why doesn’t Julia recover from this (what’s the least invasive fix/workaround)? Is it maybe “self-inflicted”, I often do CTRL-C while precompiling (to avoid OOM).
I checked some versions down to 1.6 same error as above, but in 1.5 different:
(pharaldsson) pkg> add Sentinel
┌ Error: Could not parse entry for `deps`
└ @ Pkg.Types /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Pkg/src/manifest.jl:146
ERROR: MethodError: no method matching get(::Pair{String,Any}, ::String, ::Nothing)
I believe it only happens if you have a Manifest.toml file, and it’s kind of in the way, and you can move it out of the way be renaming it (maybe you’re even ok with deleting, I’m just unsure when it might have critical info for your project that you might want to preserve; myself I’ve never had to):
mv Manifest.toml Manifest.toml_old_in_the_way
in your current directory, if you were using a project there, you can also point to a fresh project directly, or if you’re not using one, then you might move the relevant file in the .julia directory…