简体   繁体   中英

Node.js: Why do we increment version number in package.json?

在普通Node.js项目中增加package.json中版本号的主要原因是什么?

Normally the code would be booked into a repository like git. Several people can work on the code and when it is released into an environment for testing the version number can be changed. The release may then be referred to by the version number.

The complexity of the changes in the release should be highlighted by the way the version number is changed.

1.0.0 -> 1.0.1 Would reflect only a small change was released. 1.2.34 -> 2.0.0 Would highlight that there has been a major release.

There is no real reason to increment it if you are only learning.

Version is just about semantics, to set the version characteristics scope you are working with for anyone who needs to know.

Lets say your version is like major.minor.patch (ex: 1.1.1) You increase: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards compatible manner, and PATCH version when you make backwards compatible bug fixes.

Extended information can be found here (as @Phix has commented)

It just a software development process to increment version on every significant update.

NPM normally follow semver versioning that is Major.Minor.Patch (ie 1.0.0).

  1. Increment MAJOR version when you make incompatible API changes,
  2. Increment MINOR version when you add functionality in a backwards compatible manner, and
  3. Increment PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM