CI + private package registry

Hello.
I’ve got a javascript project and some packages inside GitLab’s private package registry. So I’ve created .npmrc file registry URL and authToken and it works fine when I do install packages localy with yarn.
But, from CI pipeline I always got 404 on my private package.

.npmrc looks like:

@web:registry=https://git.mygitlaburl.com/api/v4/packages/npm/
//git.mygitlaburl.com/api/v4/packages/npm/:_authToken=<my-token>
//git.mygitlaburl.com/api/v4/projects/<my-project-id>/packages/npm/:_authToken=<my-token>

.gitlab-ci.yml:

stages:
  - init

bump-version:
  stage: init
  only: ['master']
  image: node:15
  script:
    - yarn

Any suggestions?

So, the only thing that helps is to change script yarn to npm install

It sounds like yarn is not installed in the node:15 image. Have you tried installing it in the before_script section? Something like:

stages:
  - init

bump-version:
  stage: init
  only: ['master']
  image: node:15
  before_script:
    - npm install yarn
  script:
    - yarn