I have two npm libraries, stored in our company's gitlab package repository. Both libraries are separate gitlab projects with different ids. If i try to use them separately - everything is fine. But I can't use them both in, let's say, third project.
I found only one solution for similar problem here, but it didn't helped me.
My steps:
STEP 1
npm config set @my-reg/library-one-project-name:registry https://gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/:_authToken" "PROJECT_ONE_TOKEN"
npm config set @my-reg/library-two-project-name:registry https://gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken" "PROJECT_TWO_TOKEN"
NPM registry file:
@my-reg/library-one-project-name:registry=https://gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/
//gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/:_authToken=PROJECT_ONE_TOKEN
@my-reg/library-two-project-name:registry=https://gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/
//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken=PROJECT_TWO_TOKEN
RESULT 1: npm tries to donwload packages from npmjs.org
STEP 2
npm config set @my-reg:registry https://gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken" "PROJECT_ONE_TOKEN"
npm config set @my-reg:registry https://gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken" "PROJECT_TWO_TOKEN"
NPM registry file:
https://gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/=
//gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/:_authToken=PROJECT_ONE_TOKEN
https://gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/=
//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken=PROJECT_TWO_TOKEN
RESULT 2: npm tries to donwload packages from npmjs.org
STEP 3
npm config set @my-scope:registry https://gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/:_authToken" "PROJECT_ONE_TOKEN"
npm config set @my-scope:registry https://gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/
npm config set "//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken" "PROJECT_TWO_TOKEN"
NPM registry file:
@my-scope:registry=https://gitlab.asseco.lt/gitlab/api/v4/projects/222222/packages/npm/
//gitlab.some.url/gitlab/api/v4/projects/111111/packages/npm/:_authToken=PROJECT_ONE_TOKEN
//gitlab.some.url/gitlab/api/v4/projects/222222/packages/npm/:_authToken=PROJECT_TWO_TOKEN
RESULT 3: npm downloads SECOND library from gitlab, but tries to donwload first package from npmjs.org
Thank you in advance.