NPM: pull packages from gitlab

lets say you want to download package from a private repo “werm-fw-templates”

npm config set @werm-fw-templates:registry https://gitlab.selectiont.com/api/v4/packages/npm/
npm config set -- '//gitlab.selectiont.com/api/v4/packages/npm/:_authToken' "$GITLAB_TOKEN"

another way for project

echo "@werm-fw-templates:registry=https://gitlab.selectiont.com/api/v4/packages/npm/" > .npmrc
echo "//gitlab.selectiont.com/api/v4/packages/npm/:_authToken=\${GITLAB_TOKEN}" >> .npmrc
npm i <package>

Leave a Reply

Your email address will not be published.