Skip to content
BENIBIX Learn

Version Pinning

Development🛠️ Editors & ToolsDevelopment Environments

Also known as Pinned Version, Pin a Dependency, Exact Version

Asking for one set version of a package. Then it does not change by itself.

Think of it like

It is like asking for the red cup, not just any cup. You get the same one each time.

Example

A new version of a chart package broke Lucy's app overnight. She pins it to the last good version, and the app works again.

Why it matters

It keeps a working app working. A surprise update can no longer break it while you sleep.

Definition

Version pinning means asking for one exact version of a package, not a range. Writing react 18.3.1 is a pin. Writing ^18.3.1 is a range, so any later 18 version may come in. A pin means nothing changes until you change it. The cost is that fixes do not arrive by themselves, so you update the pins by hand or with a bot.

Example code

json
"dependencies": {
  "react": "18.3.1",
  "lodash": "^4.17.21"
}
React is pinned to one version. Lodash takes a range, so newer 4.x fixes may come in.
A pin names one version. A range with ^ lets newer ones come in.

Common mistake

Pinning all of it and never updating. Old versions keep their known holes, so plan to move the pins.

Key takeaways

  1. 1
    Exact, not a range. One version and no other.
  2. 2
    Stable. Nothing changes until you change it.
  3. 3
    Update on purpose. Move the pins on a schedule.

Compare

Learn it properly