我们的项目依赖第三方库时,会在package.json这样记录
"dependencies": {
"xbossdebug-web": "^1.0.0"
"xbossdebug-web": "~1.0.0"
}
下面是关于^和~符号stackoverflow的解释
In the simplest terms, the tilde matches the most recent minor version (the middle number). ~1.2.3 will match all 1.2.x versions but will miss 1.3.0.
如果设置~1.2.3时,会下载1.2.3到1.2.9中存在的最新版本,但是不会下载1.3.0版本
The caret, on the other hand, is more relaxed. It will update you to the most recent major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.
如果设置^1.2.3时,会下载1.2.3到1.9.9中存在的最新版本,但是2.0.0就不会被下载