Artifactory supports installing an npm package using the Yarn client.
To install an npm package with Yarn:
Run the following command:
yarn add <PACKAGE_NAME>
Where:
<PACKAGE_NAME>: The name of the package you want to install, including the @<SCOPE>/ prefix for scoped packages
For example:
yarn add @company/lodash
To install packages from a specific registry:
Run the following command:
yarn add <PACKAGE_NAME> --registry [JFrogPlatformURL]/artifactory/api/npm/<REPO_NAME>/Where:
<PACKAGE_NAME>: The name of the package you want to install[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository
For example:
yarn add lodash --registry https://company.jfrog.io/artifactory/api/npm/npm-local/Note
You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.