You need to enable JavaScript to run this app.
Container Registry

Container Registry

Copy page
Download PDF
Getting started
Upload and download NPM packages
Copy page
Download PDF
Upload and download NPM packages
An artifact repository supports hosted packages, allows users to create artifact repositories, and to upload and download packages. This document explains how to quickly use the artifact repository for uploading and downloading NPM packages.​
Prerequisites​
  • To enable IAM users to operate the artifact repository, please ensure that the relevant policies and role authorization for the artifact repository have been completed. For specific operating instructions, refer to Permission management.​
Procedure​
Step 1: Create an instance​
  1. Log in to the Artifact repository console.​
  1. In the left navigation bar, click Instances. Then, in the Instances area on the right page, click Create a Basic Edition Instance.​
  1. Configure the instance parameters.​
  • ​
    Parameter​
    Description​
    Instance Name​
    The name of the instance, which cannot be modified.​
    Repository Domain Name​
    The domain name for accessing the repository, which is automatically generated by the system and cannot be modified.​
    Billing method​
    The billing method of the instance. Currently, only Pay-as-you-go is supported and cannot be modified.​
    ​
  1. Click Confirm to navigate to the Confirm Order interface.​
  1. After confirming the configuration details, billing type, purchase quantity, and price in the order, if there are no issues, check the box for I have read and agreed to the "Service Terms for the Basic Edition of Artifact Repository".​
  1. Click confirm and wait for the system to complete instance creation.​
Step 2: Create a repository​
  1. In the left navigation bar, select Instances. In the Instances area on the right page, click to enter the artifact repository instance.​
  1. At the top of the left navigation bar, select the NPM package format, and then in the menu bar, choose Repository Management and click on New Repository to enter the repository configuration page.​
  1. Configure the parameters of the artifact repository.​
  1. Click Confirm.​
Step 3: Configure repository credentials​
  1. In the dropdown menu at the top of the left navigation bar, select the Maven package format, and in the menu bar, choose registry management.​
  1. In the registry management list, click Set Permanent Credential. The credentials for the artifact repository can now be configured.​
  1. Configure local credentials.​
  • When the local environment is a Mac system, execute the following command to configure access credentials.​
  • ​
    npm config set //{repository_url}:_auth=$(echo -n '{username}:{password}' | base64)​
    ​
  • When the local environment is a Linux system, execute the following commands to configure access credentials.​
  • ​
    npm config set //{repository_url}:_auth=$(echo -n '{username}:{password}' | base64 -w 0)​
    ​
    ​
Step 4: Upload package​
Execute the following command to push the package to the artifact repository.​
​
npm publish --registry={registry}​
​
Step 5: Download package​
Execute the following command to download packages.​
​
npm install <PACKAGE>@<VERSION> --registry={registry}​
​
View results​
  1. Use the command to upload the package.​
  • ​alt​​
  1. Enter the artifact repository, and you will be able to view the uploaded packages.​
​
Last updated: 2025.10.24 11:20:36