我有以下 bower.json 文件:
{
"private": true,
"dependencies": {
"angular": "~1.5.0",
"angular-mocks": "^1.5.7",
"bootstrap": "^3.3.6",
"bootstrap-rtl": "^3.4.0",
"font-awesome": "^4.6.3",
"moment": "^2.13.0",
"angular-animate": "^1.5.6",
"angular-sanitize": "^1.5.6",
"angular-ui-router": "~0.2.15",
"angular-translate": "^2.11.0",
"angular-touch": "^1.5.7",
"angular-messages": "^1.5.6",
"angular-cookies": "^1.5.8",
"angular-ui-grid": "^3.1.1",
"angular-ui-sortable": "^0.14.2",
"angular-bootstrap-affix": "^0.2.2",
"theia-sticky-sidebar": "^1.4.0",
"angular-ui-router-title": "^0.0.4",
"angularjs-slider": "^4.0.2",
"angular-fcsa-number": "^1.5.3",
"angularPrint": "angular-print#^0.3.8",
"ng-virtual-keyboard": "^0.3.0",
"keyboard": "^1.26.1",
"angular-spinner": "^0.8.1",
"ng-ip-address": "^1.1.10",
"file-saver": "^1.3.2",
"ng-iban": "^1.1.0",
"pdfmake": "^0.1.20",
"ng-device-detector": "^3.0.1",
"checklist-model": "^0.10.0",
"angular-dynamic-number": "^2.1.1",
"ng-file-upload": "^12.2.13",
"ng-file-upload-shim": "^12.2.13",
"angular-ui-select": "^0.19.6",
"angular-dragula": "^1.2.8",
"angular-drag-and-drop-lists": "^2.0.0",
"angular-slick-carousel": "^3.1.7",
"angular-slick": "^0.2.1",
"drag-drop-webkit-mobile": "^1.2.0",
"iban": "^0.0.8",
"highcharts": "^5.0.9"
}
}
我只想将 AngularJS 更新到版本 1.5.8
。没有任何头痛地进行此更新的最佳方法是什么?我尝试安装 bower install angular#1.5.8 --save
,但是当其他团队成员输入 bower-update
时,他们的整个项目都崩溃了,因为很多包都更新了。
任何好主意如何只更新 AngularJS?
最佳答案
尝试 "angular": "1.5.8"
,并运行 bower update
而不是 bower-update
。您可能会在所有依赖项上切换到波浪号 ~
以确保只更新次要版本。请注意,angular-mocks
与 AngularJS 版本不对应。
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.
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.
{
"private": true,
"dependencies": {
"angular": "1.5.8",
"angular-mocks": "~1.5.7",
"bootstrap": "~3.3.6",
"bootstrap-rtl": "~3.4.0",
"font-awesome": "~4.6.3",
"moment": "~2.13.0",
"angular-animate": "~1.5.6",
"angular-sanitize": "~1.5.6",
"angular-ui-router": "~0.2.15",
"angular-translate": "~2.11.0",
"angular-touch": "~1.5.7",
"angular-messages": "~1.5.6",
"angular-cookies": "~1.5.8",
"angular-ui-grid": "~3.1.1",
"angular-ui-sortable": "~0.14.2",
"angular-bootstrap-affix": "~0.2.2",
"theia-sticky-sidebar": "~1.4.0",
"angular-ui-router-title": "~0.0.4",
"angularjs-slider": "~4.0.2",
"angular-fcsa-number": "~1.5.3",
"angularPrint": "angular-print#~0.3.8",
"ng-virtual-keyboard": "~0.3.0",
"keyboard": "~1.26.1",
"angular-spinner": "~0.8.1",
"ng-ip-address": "~1.1.10",
"file-saver": "~1.3.2",
"ng-iban": "~1.1.0",
"pdfmake": "~0.1.20",
"ng-device-detector": "~3.0.1",
"checklist-model": "~0.10.0",
"angular-dynamic-number": "~2.1.1",
"ng-file-upload": "~12.2.13",
"ng-file-upload-shim": "~12.2.13",
"angular-ui-select": "~0.19.6",
"angular-dragula": "~1.2.8",
"angular-drag-and-drop-lists": "~2.0.0",
"angular-slick-carousel": "~3.1.7",
"angular-slick": "~0.2.1",
"drag-drop-webkit-mobile": "~1.2.0",
"iban": "~0.0.8",
"highcharts": "~5.0.9"
}
}
关于javascript - 将 AngularJS 从 1.5.0 更新到 1.5.8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43067317/