简体   繁体   中英

package.json version # prefix options?

I'm new to grunt and making updates to an existing project. Several dependencies are listed in the dependencies object in package.json but the version number is specified in different ways for different dependencies. For example:

  • "@angular/common": "~2.1.0"
  • "bootstrap": "^3.3.7"
  • "rxjs": "5.0.0-rc.4"

What is the significance of '~', '^' and no prefix in front of the package version? Are there any other prefix options that aren't listed above?

Tilde Ranges Matches the most recent minor version Ex: ~2.1.0 means >=2.1.0 <2.(1+1).0

Caret Ranges Matches the most recent major version Ex: ^3.3.7 := >=3.3.7 <4.0.0

Specific latest version "5.0.0-rc.4" The latest stable version of the package.

This link will explain you about your question. Check this

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