I have a private npm package that is published to the Gitlab Package Registry using a Gitlab CI pipeline.
I want to install this package in a project using yarn.
Following the documentation helped me come up with the following .npmrc
file :
//gitlab.com/api/v4/packages/npm/:_authToken=glpat-***********
@my-org:registry=https://gitlab.com/api/v4/packages/npm/
With the above, npm install @my-org/my-package
works perfectly.
However, yarn add @my-org/my-package
fails. using --verbose
shows a 404 :
verbose 1.169823875 Error: https://gitlab.com/api/v4/projects/<my-project-id>/packages/npm/@my-org/my-package/-/@my-org/my-package-1.0.3.tgz: Request failed "404 Not Found"
error An unexpected error occurred: "https://gitlab.com/api/v4/projects/<my-project-id>/packages/npm/@my-org/my-package/-/@my-org/my-package-1.0.3.tgz: Request failed \"404 Not Found\""
The package does exist at version 1.0.3, NPM installs it.
- I need to get this to work with Yarn. How can I do this ?
- Additionaly, is there a way to take the authToken out of the
.npmrc
file ?