Distribution tags (dist-tags) are human-readable labels that you can use to organize and label different versions of packages you publish. dist-tags supplement semantic versioning. In addition to being more human-readable than semantic version numbering, tags allow publishers to distribute their packages more effectively.
For more information, see the
dist-tag CLI documentation.
By default, running
npm publish will tag your package with the
latest dist-tag. To use another dist-tag, use the
--tag flag when publishing.
<tag>with the tag you want to use:
npm publish --tag <tag>
To publish a package with the “beta” dist-tag, on the command line, run the following command in the root directory of your package:
npm publish --tag beta
<package_name>with the name of your package,
<version>with your package version number, and
<tag>with the distribution tag:
npm dist-tag add <package-name>@<version> [<tag>]
To add the “stable” tag to the 1.4.0 version of the “example-package” package, you would run the following command:
npm dist-tag add [email protected] stable