1NPM-DIST-TAG(1) NPM-DIST-TAG(1)
2
3
4
6 npm-dist-tag - Modify package distribution tags
7
9 npm dist-tag add <pkg>@<version> [<tag>]
10 npm dist-tag rm <pkg> <tag>
11 npm dist-tag ls [<pkg>]
12
13 aliases: dist-tags
14
16 Add, remove, and enumerate distribution tags on a package:
17
18 · add: Tags the specified version of the package with the specified
19 tag, or the --tag config if not specified. If you have two-factor
20 authentication on auth-and-writes then you’ll need to include a
21 one-time password on the command line with --otp <one-time password>.
22
23 · rm: Clear a tag that is no longer in use from the package.
24
25 · ls: Show all of the dist-tags for a package, defaulting to the pack‐
26 age in the current prefix. This is the default action if none is
27 specified.
28
29
30 A tag can be used when installing packages as a reference to a version
31 instead of using a specific version number:
32
33 npm install <name>@<tag>
34
35 When installing dependencies, a preferred tagged version may be speci‐
36 fied:
37
38 npm install --tag <tag>
39
40 This also applies to npm dedupe.
41
42 Publishing a package sets the latest tag to the published version
43 unless the --tag option is used. For example, npm publish --tag=beta.
44
45 By default, npm install <pkg> (without any @<version> or @<tag> speci‐
46 fier) installs the latest tag.
47
49 Tags can be used to provide an alias instead of version numbers.
50
51 For example, a project might choose to have multiple streams of devel‐
52 opment and use a different tag for each stream, e.g., stable, beta,
53 dev, canary.
54
55 By default, the latest tag is used by npm to identify the current ver‐
56 sion of a package, and npm install <pkg> (without any @<version> or
57 @<tag> specifier) installs the latest tag. Typically, projects only use
58 the latest tag for stable release versions, and use other tags for
59 unstable versions such as prereleases.
60
61 The next tag is used by some projects to identify the upcoming version.
62
63 By default, other than latest, no tag has any special significance to
64 npm itself.
65
67 This command used to be known as npm tag, which only created new tags,
68 and so had a different syntax.
69
70 Tags must share a namespace with version numbers, because they are
71 specified in the same slot: npm install <pkg>@<version> vs npm install
72 <pkg>@<tag>.
73
74 Tags that can be interpreted as valid semver ranges will be rejected.
75 For example, v1.4 cannot be used as a tag, because it is interpreted by
76 semver as >=1.4.0 <1.5.0. See https://github.com/npm/npm/issues/6082.
77
78 The simplest way to avoid semver problems with tags is to use tags that
79 do not begin with a number or the letter v.
80
82 · npm help publish
83
84 · npm help install
85
86 · npm help dedupe
87
88 · npm help 7 registry
89
90 · npm help config
91
92 · npm help 7 config
93
94 · npm help 5 npmrc
95
96
97
98
99
100 October 2019 NPM-DIST-TAG(1)