It is because the folders under usr/share/julia/stdlib/v1.7 are all symbolic links. They became invalid after being moved to another server. (Thanks @fredrikekre 's suggestion, checking with isfile(joinpath(Base.load_path_expand("@stdlib"), "Pkg", "Project.toml")) return false.) After I replaced them with the real folders from stdlib/, the problem is solved. Maybe I should distribute self-compiled julia using rsync -L to avoid invalid symbolic links.
2 Likes