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
First, make sure you have access and are set up according to the Artifactory guide.
Get your Identity Token from https://jackhenry.jfrog.io/ui/user_profile.
Add these environment variables to your Bash/Zsh shell profile, e.g.:
echo 'export ARTIFACTORY_TOKEN=<identity-token>' >> ~/.zshrcAlternative: storing secrets in plain text in your
.zshrcis 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.
.bashrcor.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
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} EOFTest your npm configuration to see if you can connect to the @banno Artifactory registry:
npm info @banno/node-templateIf 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.
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 yarnEnable corepack
corepack enable- Note: If using
asdfto manage your Node.js versions, you’ll also need to runasdf reshim nodejs
- Note: If using
Install Yarn
corepack install --global yarnCreate .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/" EOFTest your configuration
yarn npm whoami --scope=bannoIf 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.