🛠️Version Pinning
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
Example code
json
"dependencies": {
"react": "18.3.1",
"lodash": "^4.17.21"
}Common mistake
Key takeaways
- 1Exact, not a range. One version and no other.
- 2Stable. Nothing changes until you change it.
- 3Update on purpose. Move the pins on a schedule.