Set Up Yarn with Artifactory

JFrog Artifactory Documentation

JFrog Artifactory
Content Type
User Guide

For your Yarn package manager to work with Artifactory, you first need to authenticate Yarn with Artifactory by updating your npm config file, (i.e the .npmrc file), with the credentials from Artifactory as follows:

  1. For Yarn to work with Artifactory, you first need to set the default npm registry with an Artifactory npm repository using the following command (the example below uses a repository called npm-repo ):

    npm config set registry<npm repository name>/
  2. Once you have set the default registry, you need to authenticate the npm client to Artifactory.

    npm config set always-auth true
  3. Run the following command in your npm client. When prompted, provide your Artifactory login credentials:

    npm login 

    At this point, the .npmrc file will be updated and will display the following confirmation.

    registry=<npm repository name>/
    //<npm repository name>/

    You can start using Yarn for installing and publishing packages.