Skip to content

Update Package Registry NPM Troubleshooting documentation

What does this MR do and why?

Improve the Package Registry documentation for NPM to address problems reported around installing packages with private dependencies. Reported in #352962 (closed).

How to set up and validate locally

  • Setup 2 groups, with projects hosting packages:

    flowchart TD
    Group1 --- ProjectB --- PackageB
    Group1 --- ProjectC --- PackageC
    Group2 --- ProjectA --- PackageA
  • Setup this interdependency between packages A, B, and C:

    flowchart TD
    PackageA --- PackageB --- PackageC
  • Create a project that installs PackageA using the CI pipeline.

  • Test the example .npmrc configurations in the MR change.

Example CI pipeline snippet:

    # This tests installing a package with dependencies within one group
    - echo "//${CI_SERVER_HOST}/:_authToken=${GROUP_TOKEN}">.npmrc
    - echo "@radamanthus-testing:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/">>.npmrc
    - npm i @group1/packageb --verbose

    # This tests installing a package with dependencies across multiple groups
    #- echo "//${CI_SERVER_HOST}/:_authToken=${PERSONAL_TOKEN}">.npmrc
    #- echo "@group1:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/">>.npmrc
    #- echo "@group2:registry=https://${CI_SERVER_HOST}/api/v4/packages/npm/">>.npmrc
    #- npm i @group2/packagea --verbose

This is the project I used to test: https://gitlab.com/radamanthus-testing/project-a The projects and the groups are private because that is needed to demonstrate the issue. Please ping if you need me to add you to the groups.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #352962 (closed)

Edited by Radamanthus Batnag

Merge request reports

Loading