npm install of private npm registry is failing

I've figured it out...

Everything is fine other than @myorg does not match my gitlab org name.

e.g. the gitlab url is something like this:

https://gitlab.com/my-company/...

instead it needs to match the github url, so in the above example

@my-company

After switching this it all kicked into life and I am able to get the npm package.


My cents to help someone.

When you create a repository to handle with Package Registry, then you've created in a group or in your own user. It's very important to observe where you created it. Probably your registry repository url is something like this:

https://your.gitlab.com/{name_of_group_or_name_of_user}/[{optional_subgroup}/]{repository_registry_name}

Now, let's say you've a package in the url:

https://your.gitlab.com/my-group/my-package

And the url registry is:

https://your.gitlab.com/main/registry

The @scope of your my-package needs being @main/my-package, and not @my-group/my-package. If you define wrong @scope here, it gives you 404.

my-package:

{
    "name": "@main/my-package",
     ...
}

The @scope is the first segment of the url of your registry repository path.