在安装凉亭组件之前恢复到状态

时间:2015-06-20 00:28:14

标签: angularjs bower restore bower-install

我刚刚在Bower上安装了angular-pdf,在安装过程中,它问我

Unable to find a suitable version for angular, please choose one:
    1) angular#>=1 <1.3.0 which resolved to 1.2.28 and is required by angular-bootstrap#0.12.0
    2) angular#1.3.15 which resolved to 1.3.15 and is required by angular-cookies#1.3.15, angular-pdf#0.4.0
    3) angular#>= 1.0.8 which resolved to 1.4.1 and is required by ui-router#0.2.13Prefix the choice with ! to persist it to bower.json

认为最好使用最旧的版本以获得最大的兼容性,我选择了3。

然而,这似乎引起了问题。首先,它似乎重新安装了Angular。

当我现在运行我的网站时,我得到了

TypeError: $browser.addPollFn is not a function
    at Object.<anonymous> (angular-cookies.js:60)
    at Object.invoke (angular.js:4443)
    at Object.enforcedReturnValue [as $get] (angular.js:4296)
    at Object.invoke (angular.js:4443)
    at angular.js:4261
    at getService (angular.js:4402)
    at Object.invoke (angular.js:4434)
    at Object.enforcedReturnValue [as $get] (angular.js:4296)
    at Object.invoke (angular.js:4443)
    at angular.js:4261

在我运行Bower安装之前,有什么方法可以将所有内容恢复原状吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

bower.json中,您将获得有关您使用过的角度分辨率的部分

这样的事情:

"resolutions": {
    "angular": ">= 1.0.8"
}

只需删除此部分,然后在devDependencies中将“angular”版本设置为1.3.15,最后在终端中运行bower install,我认为版本1.3.15的角度将生效