Publishing New Package to Registry
✍ Last Updated : January 7, 2023
🚪 Prequisite Knowledge (Optional)
UploadDescribe Initial Knowledge that reader need to know before reading this article
- Node.js and NPM Basics
- CLI
❓ Key Question / Problem / Issue
Describe what question / Problem / Issue this knowledge should answer
- How To Publish New Package to Agate Internal Node Registry
✅ Expected Output/Definition of Done
Define what information you really need and the definition of done
Package Listed in Internal Registry Page
🎁 Resulting Solution
Write writing results below
To Publish npm package it is required to have few requirement below
-
Ensure your machine have Node JS Installed
[Installing Node.js To Your Windows Machine](Installing Node js To Your Windows Machine b78197dd346e46eaa3f2aeadef6bb1b2.md)
-
A package conforming npm standards
you can find a sample of `package.json all over the internet
-
package registry api url
-
public npm registry (built in default registry of npm)
-
agate internal package registry
-
-
Registry Authentication Token
-
every registry have their own authentication mechanism
-
for internal registry please ask devops team to provide registry account to use.
(Legacy) Authenticating to Agate Internal Verdaccio Registry
-
Publishing Package
-
Get .npmrc location. Get .npmrc location, with :
npm config get userconfig
-
Check .npmrc file. It content should contain registry address and it’s authentication token
-
Go to package folder (Folder with Package.json Files)
-
Publish to Package Registry with this command.
npm publish --registry=<registry url>