This topic describes how to manage packages in an NPM private repository.
Prerequisites
Before you can manage packages in an NPM private repository, you must create an NPM repository. For more information, see Create an NPM repository.
Use an NPM repository
In your NPM repository, click User Guide. You can download the .npmrc file from the download link or follow the instructions to configure push and pull settings. You can also click the eye icon in the account area to view your NPM username and password.
On the NPM Configuration tab, select Push. Step 1: Set repository credentials. Run npm config set registry=<repository_url> to specify the registry, and then run npm login and enter your username and password to log in. Step 2: Push the package. Run npm publish.
View and manage NPM packages
On the repository homepage, click the package list to view all packages in the repository. Click the search icon to search for packages by name.
The package list page displays package information in a table with columns such as Package Name, Latest Version, Last Updated, Storage Size, Versions, Downloads, Last Downloaded, and Actions (Delete).
Package version details
Click the package name to open the artifact details page. The page displays the detailed information for the latest version of the artifact by default, and you can click to switch to other versions.
The right-hand panel on the package details page shows package information (total versions, storage size, package tags), version information (pushed by, push time), dependencies, and two tabs: File Information and Metadata. At the bottom, you can find the NPM installation command (for example, npm install expressjs-hello), the Delete This Version button, and the Disable Artifact switch.
Disable a package version
On the package details page, click Disable Artifact and enter a reason to disable the package version.
Note that disabling applies to a specific version, not the entire package. For example, if you disable version 1.0.0 of web-server-demo on its details page, version 1.0.0 cannot be downloaded. However, other versions, such as 1.0.1, can still be downloaded and used.
Manage package metadata
On the package details page, switch to the desired version and click the Metadata tab. Here, you can manage the metadata for the package version. The metadata applies only to the specified version.
Custom metadata is displayed as key-value pairs, such as owner=demo and release=v1. You can edit or delete existing entries, or click Add Metadata to add a new entry.
Delete a package version
On the package list page, click a package name to open the details page. Click Delete This Version to delete the corresponding version.
After deletion, you can go to the repository homepage, click Recycle Bin, and then click the restore icon
to restore the version.
Alternatively, you can click the Permanently Delete icon to permanently delete the version.