Cannot log into our npm registry

Hi folks. I cannot get how to login into gitlab npm registry

I run: npm login --scope=@myorg --registry=https://gitlab.com/api/v4/packages/npm/

It then asks for a username. So I enter the name that is listed in my Profile after the @ sign. Then goes the password question and I enter the password that I use to login into GitLab Then the email question, and here I type what I use when login as well.

Yet, after all these steps it’s repeatedly saying:
Not Found - PUT https://gitlab.com/api/v4/packages/npm/-/user/org.couchdb.user:<myusername>

So what am I assumed to enter there to get logged in?

Actually, I wouldn’t expect to be asked any of those questions at all since I do have the proper .npmrc file located right in the project directory.

Thanks in advance.

Sorry for being a little insisting. Is there maybe some limitations or something that prevents GitLab to function as a proper npm registry and of which one should be aware of?

I think you have the URL incorrect:

https://your_domain_name/api/v4/projects/your_project_id/packages/npm/

yours is missing the project ID so it doesn’t know which project to find your NPM registry.

See: npm packages in the Package Registry | GitLab

1 Like