Resolve npm Packages using dist-tags

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

You can use npm dist-tags to install npm packages from Artifactory.

To install a package using a dist-tag, use the following command:

Note

Make sure to replace the placeholders in bold with your own package name, dist-tag

npm install <PACKAGE_NAME>@<DIST-TAG> 

By default, the npm install command will return the first package with the dist-tag that appears in the priority resolution order you have configured. Starting from Artifactory version 7.75.3, you can modify this behavior by using the following system properties, in your Repositories Configurations in Artifactory YAML file:Repositories Configurations in Artifactory YAML

  • To install the latest SemVer version of the package with the dist-tag in your priority resolution repositories, set the artifactory.npm.merge.latest.dist.tag.base.strategy.enabled=true system property.

  • To install the most recently created version of the package with the dist-tag in your priority resolution repositories, set the following: artifactory.npm.merge.latest.dist.tag.base.strategy.enabled=true and artifactory.npm.tag.tagLatestByPublish=true system properties.