Version Range
noun
say it: “VUR-zhun RAYNJ” /ˈvɝʒən reɪndʒ/
The set of versions of a package a project will accept, written with a symbol such as ^ or ~ before the version number.
What is a version range in package.json?
A version range says which versions of a package your project accepts. ^4.21.0 takes any newer 4.x, ~4.21.0 only newer 4.21.x fixes, and 4.21.0 with no symbol exactly that one.
"dependencies": {
"express": "^4.21.0",
"zod": "~3.23.8"
}
In a sentence
- “Before upgrading, Priya checked each package's version range in package.json to see how far npm could go on its own.”
- “The version range ^4.21.0 let npm install 4.22.1 but never 5.0.0.”
Level: Journeyman · More Node.js terms at this level
Updated