我有grunt-ember-templates插件,它曾经工作过。但是我做了一个npm install,结果搞砸了。现在它不能编译。
错误是这样的:
Running "watch" task
Waiting...
>> File "resources\hbs\index\module.hbs" changed.
Running "emberTemplates:compile" (emberTemplates) task
>> ReferenceError: ember-template-compiler.js:22258
>> module.exports = Ember.__loader.require("ember-template-compiler");
>> ^
>> module is not defined
Warning: Ember Handlebars failed to compile resources/hbs/error.hbs. Use --force to continue.
Aborted due to warnings.我的Gruntfile.js看起来像这样:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
emberTemplates: {
compile: {
options: {
templateBasePath: /resources\/hbs\//,
// Path to the ember-template-compiler of my ember version
templateCompilerPath: 'resources/js/libs/ember-template-compiler.js',
handlebarsPath: 'node_modules/handlebars/dist/handlebars.js'
},
files: {
'resources/js/templates.js': 'resources/hbs/**/*.hbs'
}
}
},
...有什么想法吗?提前谢谢。
发布于 2015-08-10 15:53:18
FWIW,这只是一个依赖问题。修改package.json以包含最新的包修复了它。
https://stackoverflow.com/questions/31880693
复制相似问题