Skip to main content

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

  1. Node.js and NPM Basics
  2. CLI

❓ Key Question / Problem / Issue

Describe what question / Problem / Issue this knowledge should answer

  1. 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

  1. Ensure your machine have Node JS Installed

    [Installing Node.js To Your Windows Machine](Installing Node js To Your Windows Machine b78197dd346e46eaa3f2aeadef6bb1b2.md)

  2. A package conforming npm standards

    package.json | npm Docs

    you can find a sample of `package.json all over the internet

  3. package registry api url

    1. public npm registry (built in default registry of npm)

      npm

    2. agate internal package registry

      internal-npm

      https://test-proget.agatedev.net/npm/internal-npm/

  4. Registry Authentication Token

    1. every registry have their own authentication mechanism

    2. for internal registry please ask devops team to provide registry account to use.

      (Legacy) Authenticating to Agate Internal Verdaccio Registry

Publishing Package

  1. Get .npmrc location. Get .npmrc location, with :

    npm config get userconfig
    
  1. Check .npmrc file. It content should contain registry address and it’s authentication token

    Untitled

  2. Go to package folder (Folder with Package.json Files)

  1. Publish to Package Registry with this command.

    npm publish --registry=<registry url>
    

    Untitled