Setting Up the Package Registry
To utilize the package registry, you first need to configure a new package source. This can be accomplished with the following commands:
npm config set "//gitea.example.com/api/packages/{owner}/npm/:_authToken" "{token}"
The parameters used in the command are defined as follows:
Parameter |
Description |
---|---|
scope |
The scope of the packages. |
owner |
The owner of the package. |
token |
Your personal access token. |
For instance, if you want to set the registry for a scope @sample and an owner testuser, you would use:
npm config set @sample:registry https://gitea.example.com/api/packages/testuser/npm/
npm config set “//gitea.example.com/api/packages/testuser/npm/:_authToken” “personal_access_token”
How to Publish NPM Packages in the Package Registry ?
The npm Package Registry serves as an invaluable tool for publishing npm packages for individual developers or organizations.
This article will guide you through the requirements, configuration, and usage of the npm package registry.
Table of Content
- Setting Up the Package Registry
- Publishing a Package
- Authenticating via the .npmrc
- Publishing a package via the command line
- Publishing a package by using a CI/CD pipeline
- Unpublishing a Package
- Installing a Package
- Tagging a Package
- Searching Packages
- Supported Commands
- Conclusion
Contact Us