Artifactory (NPM)

3 Easy Steps

Teams using JFrog Artifactory can manage access to NES packages through 3 easy steps:

  1. Create a Remote Repository for our private NPM registry.
  2. Configure (or create) a Virtual Repository to leverage the newly created Remote Repository.
  3. Verify your developers are able to access our package through your Virtual Repository.

Step 1: Create a Remote Repository

  1. Navigate to the Administration tab (top navbar next to Application) "Step 1"
  2. Select Repositories (left side navbar) "Step 2"
  3. Navigate to the Remote subtab. "Step 3"
  4. Select Create Repository > Remote, and then select NPM as the type. "Step 4a""Step 4b"
  5. Configure the following parameters on the Basic tab: "Step 5"
  6. Configure the following on the Advanced tab:

"Step 6"

The final results should look similar to the following:

Basic

"Result-Basic"

Advanced

"Result-Advanced"

Step 2: Configure a Virtual Repository

In this step, you should configure the virtual repository referenced in the .npmrc files. This step is fairly straight forward, and only requires adding our private NPM registry after the public npmjs.org registry.

  1. Navigate to the Administration tab "Step 1"
  2. Select Repositories"Step 2"
  3. Navigate to Virtual subtab "Step 3"
  4. Select Create Repository > Virtual"Step 4"

Whether creating or editing a new Virtual Repository, ensure both "npm-remote" and "nes" repositories are included in Selected Repositories with "nes" at the bottom of the list.

In most versions of Artifactory, you should see the following:

"Virtual-Setup"

Step 3: Verify Access

With your Virtual Repository keyed as npm-default and assuming that you have a valid Artifactory username / password, configure your .npmrc accordingly:

.npmrc
registry=<artifactory_url>/artifactory/api/npm/<virtual_repository_key>/
<artifactory_url>/artifactory/api/npm/<virtual_repository_key>/:_password=<base64_artifactory_password>
<artifactory_url>/artifactory/api/npm/<virtual_repository_key>/:username=<artifactory_email>
<artifactory_url>/artifactory/api/npm/<virtual_repository_key>/:email=<artifactory_email>
<artifactory_url>/artifactory/api/npm/<virtual_repository_key>/:always-auth=true

The above will replace the following if your .npmrc file already contains the following (i.e. you are already using our product and are integrating Artifactory after the fact):

.npmrc
@neverendingsupport:registry=https://registry.nes.herodevs.com/npm/pkg/
//registry.nes.herodevs.com/npm/pkg/:_authToken=<NES_ACCESS_TOKEN>

Once configured, Artifactory will attempt to download packages under the @neverendingsupport namespace from our private registry. Run npm install in a project containing a @neverendingsupport dependency in it to verify that you are properly set-up.