AngularJS应用程序部署到Heroku,无法找到合适的角度动画版本

Zac*_*ook 3 heroku angularjs bower

我正在向Heroku部署AngularJS应用程序但是在控制台中出现此错误:

remote: bower    ECONFLICT Unable to find suitable version for angular-animate
remote: 
remote:  !     Push rejected, failed to compile Node.js app
remote: 
remote: Verifying deploy....
remote: 
remote: !   Push rejected to test-app-12345
Run Code Online (Sandbox Code Playgroud)

问题(当然)似乎与angular-animate依赖性有关.

我正在使用Heroku angularJS buildpack" Yo Angular "并按照他们的4步流程成功部署到Heroku.

我尝试通过更改我的bower.json文件来修复此问题,就像在StackOverflow回答中推荐的那样,希望它能解决我的问题.它没.

在本地,我grunt serve用来启动应用程序,这对我很有用.

bower.json看起来像这样:

{
  "name": "dashboard",
  "version": "0.0.0",
  "main": "index.html",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components"
  ],
  "dependencies": {
    "jquery": "~2.0",
    "bootstrap": "~3.1.1",
    "angular": "~1.3.15",
    "angular-ui-router": "~0.2",
    "angular-animate": "~1.3.15",
    "angular-resource": "~1.3.15",
    "angular-cookies": "~1.3.15",
    "angular-mocks": "~1.3.15",
    "angular-ui-utils": "~0.1",
    "angular-bootstrap": "~0.11.2",
    "moment": "~2.5",
    "less.js": "~1.6",
    "font-awesome": "~4.2.0",
    "form-builder": "0.1.0",
    "restangular": "~1.4.0",
    "lodash": "~2.4.1",
    "satellizer": "~0.3.2",
    "angular-xeditable": "~0.1.8",
    "fullcalendar": "~2.1.1",
    "angular-ui-calendar": "~0.8.1",
    "checklist-model": "~0.1.3"
  },
  "resolutions": {
    "font-awesome": "~4.2.0",
    "jquery": "~2.0",
    "fullcalendar": "~2.1.1",
    "angular": "~1.3.15",
    "angular-bootstrap": "~0.11.2"
  }
}
Run Code Online (Sandbox Code Playgroud)

代码现在是公开的,所以这里是Github repo的链接.

任何人都有我的提示,或者对我做错了什么的好主意?

PS我在Github问题跟踪中找到了这个信息bower,它处理同样的问题.可能有助于搞清楚这一点.

Dan*_*son 5

当两个程序包引用相同依赖项的不同版本时,会发生此错误.

您可以通过运行来解决问题 rm -rf bower_components/ ; bower install

然后当提示选择版本前缀时,你的回答是"!" 就像我在下面.注意凉亭将如何添加一个"resolutions"部分.

Unable to find a suitable version for angular-animate, please choose one:
    1) angular-animate#~1.2 which resolved to 1.2.28 and is required by form-builder#0.1.0
    2) angular-animate#~1.3.15 which resolved to 1.3.17 and is required by dashboard
    3) angular-animate#~1.4.3 which resolved to 1.4.3

Prefix the choice with ! to persist it to bower.json

? Answer: !3
Run Code Online (Sandbox Code Playgroud)

这是您解决的bower.json文件.

{
  "name": "dashboard",
  "version": "0.0.0",
  "main": "index.html",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components"
  ],
  "dependencies": {
    "jquery": "~2.0",
    "bootstrap": "~3.1.1",
    "angular": "~1.3.15",
    "angular-ui-router": "~0.2",
    "angular-animate": "~1.4.3",
    "angular-resource": "~1.3.15",
    "angular-cookies": "~1.3.15",
    "angular-mocks": "~1.3.15",
    "angular-ui-utils": "~0.1",
    "angular-bootstrap": "~0.11.2",
    "moment": "~2.5",
    "less.js": "~1.6",
    "font-awesome": "~4.2.0",
    "form-builder": "0.1.0",
    "restangular": "~1.4.0",
    "lodash": "~2.4.1",
    "satellizer": "~0.3.2",
    "angular-xeditable": "~0.1.8",
    "fullcalendar": "~2.1.1",
    "angular-ui-calendar": "~0.8.1",
    "checklist-model": "~0.1.3"
  },
  "resolutions": {
    "font-awesome": "~4.2.0",
    "jquery": "~2.0",
    "fullcalendar": "~2.1.1",
    "angular": "~1.3.15",
    "angular-bootstrap": "~0.11.2",
    "angular-animate": "~1.4.3"
  }
}
Run Code Online (Sandbox Code Playgroud)