Semantic versioning (SemVer) labels releases with three numbers, MAJOR.MINOR.PATCH, such as 2.4.1. Increase MAJOR for incompatible changes, MINOR for new features that remain backward compatible, and PATCH for backward-compatible bug fixes.
Why it matters
Version numbers tell users how risky an upgrade is. A move from 2.4.1 to 2.4.2 should be safe, 2.4.1 to 2.5.0 adds features, and 2.4.1 to 3.0.0 may require changes in your code. Package managers use these rules to choose compatible versions automatically.
Example
| Change | Old | New |
|---|---|---|
| Fix a crash | 2.4.1 | 2.4.2 |
| Add an optional parameter | 2.4.2 | 2.5.0 |
| Remove a function | 2.5.0 | 3.0.0 |
In npm, ^2.4.1 accepts any 2.x.x release at or above 2.4.1, while ~2.4.1 accepts only 2.4.x patches.
Common mistakes
- Making a breaking change in a minor or patch release, which breaks users who trusted the rules.
- Treating 0.x versions as stable; under SemVer anything may change before 1.0.0.
- Assuming every project follows SemVer; check the changelog before upgrading.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.