SPEC(7)
π NAME π
SPEC(7) is the manual page for spec β Package name specifier. Welcome to the group chat, bestie. π«Ά
πΈ Description πΈ
Okay so, commands like npm install and the dependency sections in the package.json use a package name specifier. This can be many different things that all refer to a βpackageβ β itβs giving range, honestly. Examples include a package name, git url, tarball, or local directory. These will generally be referred to as <package-spec> in the help output for the npm commands that use this package name specifier. iykyk. β¨
π Package name π
The package-name shapes are:
[<@scope>/]<pkg>[<@scope>/]<pkg>@<tag>[<@scope>/]<pkg>@<version>[<@scope>/]<pkg>@<version range>
This refers to a package by name, with or without a scope, and optionally a tag, version, or version range. This is typically used in combination with the registry config (/using-npm/config#registry) to refer to a package in a registry. periodt. π°οΈ
Examples:
npm
@npmcli/arborist
@npmcli/arborist@latest
npm@6.13.1
npm@^4.0.0
π Aliases π
<alias>@npm:<name>
Primarily used by commands like npm install and in the dependency sections in the package.json, this refers to a package by an alias. The <alias> is the name of the package as it is reified in the node_modules folder, and the <name> refers to a package name as found in the configured registry. π«Ά
See Package name above for more info on referring to a package by name, and registry (/using-npm/config#registry) for configuring which registry is used when referring to a package by name.
Examples:
semver@npm:@npmcli/semver-with-patch
semver@npm:semver@7.2.2
semver@npm:semver@legacy
π¦ Folders π¦
<folder>
This refers to a package on the local filesystem. Specifically this is a folder with a package.json file in it. This should always be prefixed with a / or ./ (or your OS equivalent) to reduce confusion. npm currently will parse a string with more than one / in it as a folder, but this is legacy behavior that may be removed in a future version. β οΈ
Examples:
./my-package
/opt/npm/my-package
π Tarballs π
<tarball file><tarball url>
Examples:
./my-package.tgz
https://registry.npmjs.org/semver/-/semver-1.0.0.tgz
This refers to a package in a tarball format, either on the local filesystem or remotely via url. This is the format that packages exist in when uploaded to a registry. π¦ fr fr.
π§ git urls π§
<git:// url><github username>/<github project>
This refers to a package in a git repo. This can be a full git url, git shorthand, or a username/package on GitHub. You can specify a git tag, branch, or other git ref by appending #ref. highkey useful. π
Examples:
https://github.com/npm/cli.git
git@github.com:npm/cli.git
git+ssh://git@github.com/npm/cli#v6.0.0
github:npm/cli#HEAD
npm/cli#c12ea07
π See also π
npm-package-arg(https://npm.im/npm-package-arg)npm help scopenpm help config
Thatβs the whole SPEC(7) vibe, bestie. This page is from NPM@11.17.0, dated June 2026 β go spec those packages and slay. πβ¨
π¦ where this page comes from
- centos-stream 10: nodejs24-npm 1:11.17.0-1.24.19.0.1.el10 Β· Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms