How to add registry with LocalRegistry

Hi all,

I am trying to setup a local registry for packages that are on a private server with git. I have completed the following steps:

  1. I installed LocalRegistry
  2. I created a local registry with create_registry, which created a folder in .julia/registries/my_local_registry
  3. I pushed the the changes in .julia/registries/my_local_registry to a dedicated repo on the private server

The registry contains a single file called Registry.toml, which contains fields for name, uuid, repo description and a blank block [packages].

The README instructs users to add the local registry with

using Pkg
pkg"registry add <repository url>"

However, I receive the following error:

     Cloning git-repo `https://xxxx`
    Updating git-repo `https://xxxx`
ERROR: could not find project file (Project.toml or JuliaProject.toml) in package at `https:/xxxx` maybe `subdir` needs to be specified

I redacted the URL. Why did it create Registry.toml but looks for Project.toml?

Thank you in advance for your help.

Are you certain that you’re doing registry add <url>? From the error it sounds like you’re doing add <url>, i.e. trying to add it as a package instead of a registry.

Thanks for your reply (and for creating this package).

I ran the following:

pkg"add registry https://xxxx"

where xxxx is the url to the repo containing the registry.

Interestingly, I was able to register packages, which automatically updated the remote registry repo.

I tried running pkg"add registry https://xxxx" on a different computer and it worked. I was able to create a new project and add the packages to the environment. Is it possible that the problem is that I ran the command on the computer I used to create the registry?

The registry is already installed on the machine where you have run create_registry but as far as I know it should be fine to add it again.

Notice that there is a big difference between

pkg"registry add <repository url>"

and

pkg"add registry https://xxxx"

but maybe the latter is a posting typo.

Thanks. That appeared to be the issue. I used “xxxx” because I did not want to paste the URL.

Everything is working very nicely. My only complaint is that I did not use this sooner :laughing: