Enhance npm command docs
What does this MR do and why?
The npm commands for setting up the package registry authentication are incomplete and lead to an 401 unauthorized error
when followed step-by-step. This MR add the two missing npm config commands to always use authentication.
Information about the two config parameters can be found at npm docs strict-ssl and npm docs always-auth
How to set up and validate locally
- Enable package registry for your repository and create an npm project.
- Add a
.gitlab-ci.yml
file with the steps documented at https://docs.gitlab.com/ee/user/packages/npm_registry/deploy: stage: deploy script: - npm config set registry https://gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/ - npm config set -- '//gitlab.example.com/api/v4/projects/<your_project_id>/packages/npm/:_authToken' "<your_token>" - npm publish
- Run the pipeline and get the following result
Response status code does not indicate success: 401 (Unauthorized)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Patrizio Bonzani