Andrea Barone
Andrea Barone

Reputation: 1

Gitlab private registry issue with .npmrc

I'm trying to publish a folder of my monorepo on the gitlab package registry. I've tried everything, but without any success.

I'm always getting:

npm ERR! need auth This command requires you to be logged in to https://gitlab.com/api/v4/projects/123456/packages/npm/
npm ERR! need auth You need to authorize this machine using `npm adduser`

I configured my .npmrc as suggested:

@pinko:registry=https://gitlab.com/api/v4/projects/123456/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=${GITLAB_AUTH_TOKEN}
//gitlab.com/api/v4/projects/123456/packages/npm/:_authToken=${GITLAB_AUTH_TOKEN}

Then I execute in the terminal:

GITLAB_AUTH_TOKEN=gdt-123456 npm publish

I tried both with deploy and personal tokens, but nothing, allowed them all the possible permission I could when creating as well. Also tried to set

npm config set -- '/gitlab.com/api/v4/projects/123456/packages/npm/:_authToken' "gdt-123456"

What am I missing?

Upvotes: 0

Views: 13

Answers (0)

Related Questions