I have published the npm package to gitlab.com without a problem.
In another private project, I want to consume this npm package. It works locally after setting up the .npmrc
with my personal access token accordingly and when executing npm install @my-org/project_a
.
However, it fails when the gitlab pipeline wants to install it with the following messages:
npm ERR! code E404
62npm ERR! 404 Not Found - GET https://gitlab.com/api/v4/projects/<id_of_project_a>/packages/npm/@my-org/project_a/-/@my-org/project_a-0.0.7.tgz
63npm ERR! 404
64npm ERR! 404 '@my-org/project_a@https://gitlab.com/api/v4/projects/<id_of_project_a>/packages/npm/@my-org/project_a/-/@my-org/project_a-0.0.7.tgz' is not in the npm registry.
I have set up the .npmrc
in the gitlab-ci.yml
as well and I have tried out several auth keys, including my personal access token and the $CI_JOB_TOKEN . I have also cleared the gitlab runner cache several times.
Accessing the url https://gitlab.com/api/v4/projects/<id_of_project_a>/packages/npm/@my-org/project_a/-/@my-org/project_a-0.0.7.tgz
also works via the browser.
Do you have an idea why it works locally and fails on gitlab ci cd even with the same access tokens and .npmrc
?
How can I debug this?