Configuration
To use the Quantum libraries, you need an Artifactory account.
-
Request an Artifactory account.
-
After receiving confirmation that your access has been granted, log in to the Artifactory platform using your credentials.
To set up your .npmrc
file so it uses an Artifactory registry instead of the default npm registry, you'll need to configure the registry URL in your npm configuration.
Here's a step-by-step guide to configure your .npmrc
file.
Setting up the Registry
To enable your package manager client to work with Artifactory, set the default npm registry URL by running the following command:
npm config set registry https://artifactory.thalesdigital.io/artifactory/api/npm/npm/
Generating an Artifactory Identity Token
To authenticate with Artifactory, generate an identity token from your profile.
- Go to your Artifactory profile settings.
- Click on the "Generate Identity Token" button.
- A popup will appear where you can add an optional description. Fill in the description if desired, then click "Next".
- Copy the generated "Reference Token".
Setting up Authentication
To authenticate with your identity token, run the following command using the identity token you copied earlier:
- macOS
- Windows
curl -u <user_email>:<identity_token> https://artifactory.thalesdigital.io/artifactory/api/npm/auth | sed 's/^_auth/\/\/artifactory.thalesdigital.io\/artifactory\/api\/npm\/npm\/:_auth/' >> ~/.npmrc
curl.exe -u <user_email>:<identity_token> https://artifactory.thalesdigital.io/artifactory/api/npm/auth >> C:/Users/<YourUsername>/<ProjectPath>/.npmrc
After that, open your C:/Users/<YourUsername>/<ProjectPath>/.npmrc
file to add a scope. Replace _auth
with //artifactory.thalesdigital.io/artifactory/api/npm/npm/:_auth
:
- _auth=<identity_token>
+ //artifactory.thalesdigital.io/artifactory/api/npm/npm/:_auth=<identity_token>
Verifying the Configuration
After configuring your .npmrc
file, verify its contents to ensure the authentication token is correctly set up.
Your .npmrc
file should look like this:
always-auth=true
registry=https://artifactory.thalesdigital.io/artifactory/api/npm/npm/
//artifactory.thalesdigital.io/artifactory/api/npm/npm/:_auth=<auth_token>