NPM-TAG(1)
π npm-tag β tagging a published version (yes bestie, it's a whole thing)
Okay so first things first, this is the npm-tag manual page, part of the npm fam, and we're about to get into it. Buckle up π
β¨ NAME β¨
npm-tag β tag a published version, that's the whole vibe π·οΈ
πΈ SYNOPSIS πΈ
npm tag <name>@<version> [<tag>]
π DESCRIPTION π
π¨ THIS COMMAND IS DEPRECATED. Like, for real. Check out npm help dist-tag for the details, that's your go-to now. π
So what it does (did?) is tag the specified version of the package with the specified tag β or it uses the --tag config if you don't hand it one. Easy.
Tags are lowkey iconic for installing packages, because you can reference a version by its tag instead of typing out a whole specific version number:
npm install <name>@<tag>
And when you're installing dependencies, you can pick a preferred tagged version like this:
npm install --tag <tag>
This also applies to npm dedupe, no cap. π
Also important: publishing a package always sets the "latest" tag to the published version. Always. Every single time. Periodt. π
π¦ PURPOSE π¦
Tags are basically aliases, so you don't have to deal with version numbers directly. For example, npm currently uses the tag "next" to identify the upcoming version, and the tag "latest" to identify the current version. It's giving main character energy honestly. β
A project might also choose to have multiple streams of development, e.g. "stable", "canary" β like parallel universes but for your releases π
π§ CAVEATS (read this part fr fr) π§
Tags have to share a namespace with version numbers, because they get specified in the same slot:
npm install <pkg>@<version>
vs
npm install <pkg>@<tag>
So yeah, same real estate π«Ά
β οΈ Heads up: tags that can be interpreted as valid semver ranges will be rejected. For example,v1.4cannot be used as a tag, because semver reads it as>=1.4.0 <1.5.0. Seehttps://github.com/npm/npm/issues/6082. Literally the semver equivalent of being misunderstood π
The simplest way to avoid semver problems with tags (the lazy-but-correct method, my fave) is to use tags that do not begin with a number or the letter v. That's it, that's the hack. π
π SEE ALSO π
npm help publishnpm help installnpm help dedupenpm help 7 registrynpm help confignpm help 7 confignpm help dist-tagnpm help 5 npmrc
And that's the whole page bestie, you ate it up π From March 2017, source/version NPM-TAG(1) β oldie but a goodie, mwah π
go forth and tag responsibly, queen π
π¦ where this page comes from
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms