简体   繁体   English

package.json版本#前缀选项?

[英]package.json version # prefix options?

I'm new to grunt and making updates to an existing project. 我是新来的咕gr人,正在对现有项目进行更新。 Several dependencies are listed in the dependencies object in package.json but the version number is specified in different ways for different dependencies. package.json中的依赖项对象中列出了几个依赖项,但是对于不同的依赖项,以不同的方式指定了版本号。 For example: 例如:

  • "@angular/common": "~2.1.0" “ @ angular / common”:“〜2.1.0”
  • "bootstrap": "^3.3.7" “ bootstrap”:“ ^ 3.3.7”
  • "rxjs": "5.0.0-rc.4" “ 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 Tilde Ranges匹配最新的次要版本,例如:〜2.1.0表示> = 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 插入符范围匹配最新的主要版本,例如:^ 3.3.7:=> = 3.3.7 <4.0.0

Specific latest version "5.0.0-rc.4" The latest stable version of the package. 特定的最新版本 “ 5.0.0-rc.4”软件包的最新稳定版本。

This link will explain you about your question. 该链接将向您解释您的问题。 Check this 检查一下

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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