我正在使用 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
?