我使用Bower来管理我的前端依赖项,使用grunt-ember-templates来预编译工具栏模板。
这些是bower.json中的依赖项
"devDependencies": {
"ember": "~1.3.1",
"jquery": "~2.0.3",
"normalize-css": "~2.1.3",
"jquery.cookie": "~1.4.0",
"font-awesome": "~4.0.3"
}..。在package.json中
"devDependencies": {
"bower": "~1.2.8",
"grunt": "~0.4.2",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"handlebars": "~1.3.0",
"ember-template-compiler": "~1.4.0-beta.1",
"grunt-ember-templates": "~0.4.18"
},但是,当我编译和运行我的Ember应用程序时,我会得到以下错误:
Assertion failed: Ember Handlebars requires Handlebars version 1.0 or 1.1, COMPILER_REVISION expected: 4, got: 5 - Please note: Builds of master may have other COMPILER_REVISION values.
Uncaught Error: Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (>= 2.0.0) or downgrade your runtime to an older version (<= 1.0.rc.2).
以下是这些版本:
> Ember.VERSION
> "1.3.2"
> Handlebars.VERSION
> "v2.0.0-alpha.1"正如您所看到的,handlebars不是显式地作为一个依赖项来提到的,而是通过Ember解析的。但不知何故,它解决了一个更新(不兼容)的版本。
如何修复handlebars的版本
发布于 2014-02-19 10:50:06
做bower install handlebars#1.3.0 --save,但是是的,这是保尔的一个问题。我看到你创造了https://github.com/bower/bower/issues/1114
https://stackoverflow.com/questions/21722230
复制相似问题