一、版本号
版本号的格式:主版本号(major).次版本号(minor).补丁版本号(patch)
主版本号
: 新的架构调整,不兼容老版本次版本号
: 新增功能,兼容老版本补丁版本号
: 修复bug,兼容老版本
version
Must matchversion
exactly>version
Must be greater thanversion
>=version
etc<version
<=version
version1 - version2
Same as>=version1 <=version2
.1.2.x
1.2.0, 1.2.1, etc., but not 1.3.0range1 || range2
Passes if either range1 or range2 are satisfied.
~version
“Approximately equivalent to version” See semver^version
“Compatible with version” See semver*
Matches any version""
(just an empty string) Same as*
http://...
See ‘URLs as Dependencies’ belowgit...
See ‘Git URLs as Dependencies’ belowuser/repo
See ‘GitHub URLs’ belowtag
A specific version tagged and published astag
Seenpm-dist-tag
path/path/path
See Local Paths below
1 | { "dependencies" : |
1 | ~version:大概匹配某个版本 |
1 | ^version:兼容某个版本 |