我正在使用Bower來管理我的前端依賴項,並使用grunt-ember-templates
來預編譯句柄模板。未捕獲的錯誤:模板已用較舊版本的Handlebars預編譯
這些都是依賴於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"
},
然而,當我編譯和運行我的灰燼應用程序,我得到這個錯誤:
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
未明確提及的依賴,而是通過灰燼是相當解決。但不知何故,它解決了一個更新的(不兼容)版本。
如何修復handlebars
的版本?
爲什麼你有開發,jquery等devDependencies下?應該可能處於依賴關係之下。對於節點包,開發依賴關係是正確的。 –