To use @banno, @jkhy, or @jack-henry scoped packages, you must configure your package manager to pull those dependencies from Artifactory.

Note: For new packages, the @banno and @jack-henry scopes should be reserved for public packages and @jkhy used for private internal packages.

Environment setup

  1. First, make sure you have access and are set up according to the Artifactory guide.

  2. Get your Identity Token from https://jackhenry.jfrog.io/ui/user_profile.

  3. Add these environment variables to your Bash/Zsh shell profile, e.g.:

    echo 'export ARTIFACTORY_TOKEN=<identity-token>' >> ~/.zshrc
    

    Alternative: storing secrets in plain text in your .zshrc is inherently insecure. A better method would be to add your secrets to your Mac’s Keychain Access app. Add a new Keychain Access item under Passwords:

    Keychain Item Name: ARTIFACTORY_TOKEN
    Account Name: <Login username for your machine>
    Password: <Your Artifactory identity token>
    

    Then, in your shell config script (i.e. .bashrc or .zshrc:

    export ARTIFACTORY_TOKEN=$(security find-generic-password -a "$USER" -s "ARTIFACTORY_TOKEN" -w)
    

    When a new shell or IDE instance is opened, your system may now prompt you to unlock your keychain. For applications that you trust, you may choose “Always Allow” after entering your password so that you are not prompted each time.

NPM or Yarn v1

  1. Set up your ~/.npmrc:

    cat > ~/.npmrc <<EOF
    @banno:registry=https://artifactory.banno-tools.com/artifactory/api/npm/npm/
    @jkhy:registry=https://artifactory.banno-tools.com/artifactory/api/npm/npm/
    @jack-henry:registry=https://artifactory.banno-tools.com/artifactory/api/npm/npm/
    //artifactory.banno-tools.com/artifactory/api/npm/npm/:_authToken=${ARTIFACTORY_TOKEN}
    EOF
    
  2. Test your npm configuration to see if you can connect to the @banno Artifactory registry:

    npm info @banno/node-template
    

    If you get E401 then submit a ticket on jhNow for access.

Yarn v2+

Yarn v2+ uses its own .yarnrc.yml file for configuration rather than sharing the ~/.npmrc file.

  1. The recommended way to install Yarn is by using corepack, so first remove any old versions of Yarn that were installed via NPM, Homebrew, etc.

    npm uninstall -g yarn
    brew uninstall yarn
    
  2. Enable corepack

    corepack enable
    
    • Note: If using asdf to manage your Node.js versions, you’ll also need to run asdf reshim nodejs
  3. Install Yarn

    corepack install --global yarn
    
  4. Create .yarnrc.yml:

    cat > ~/.yarnrc.yml <<EOF
    npmRegistries:
       //artifactory.banno-tools.com/artifactory/api/npm/npm/:
         npmAuthToken: "${ARTIFACTORY_TOKEN}"
    
    npmScopes:
      banno:
        npmRegistryServer: "https://artifactory.banno-tools.com/artifactory/api/npm/npm/"
      jkhy:
        npmRegistryServer: "https://artifactory.banno-tools.com/artifactory/api/npm/npm/"
      jack-henry:
        npmRegistryServer: "https://artifactory.banno-tools.com/artifactory/api/npm/npm/"
    
    EOF
    
  5. Test your configuration

    yarn npm whoami --scope=banno
    

    If successful, you should see something like this:

    ➤ YN0000: <username>@jackhenry.com
    ➤ YN0000: Done in 0s 437ms
    

Yarn v1 vs v2+

When running yarn for a package, Yarn v2+ sets a packageManager property in your package.json if one is not already set. In order to configure the yarn version, you must run yarn set version <version>.

For example, if still using a Yarn 1 lock file, run:

yarn set version 1

To upgrade to the latest version,

yarn set version stable

Further documentation for Yarn can be found at https://yarnpkg.com/getting-started.