恢复到安装 Bower 组件之前的状态

Revert to state before installing a bower component

我刚刚用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 之前的状态吗?

谢谢!

在您的 bower.json 中,您将有部分提到您使用的 angular 分辨率

像这样:

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

只需删除这部分,然后在您的 devDependencies 中将 "angular" 版本设置为 1.3.15,最后在终端中,运行 bower install,我认为 angular配合1.3.15版本生效