更新ember-cli插件后缺少模板处理器

时间:2015-02-18 19:56:16

标签: ember-cli ember-cli-addons

我在更新私人ember-cli插件时从终端收到以下错误:

➜ fly-blankslate git:(chore-ember-110) ember server --port=4300 version: 0.2.0-beta.1 Missing template processor Error: Missing template processor at module.exports.preprocessTemplates (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/preprocessors.js:149:11) at Class.Addon.compileTemplates (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/models/addon.js:434:12) at Class.Addon.compileAddon (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/models/addon.js:456:28) at Class.Addon.treeForAddon (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/models/addon.js:382:24) at Class._treeFor (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/models/addon.js:282:31) at Class.treeFor (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/models/addon.js:253:19) at EmberAddon.<anonymous> (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/broccoli/ember-app.js:307:20) at Array.map (native) at EmberAddon.EmberApp.addonTreesFor (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/broccoli/ember-app.js:305:30) at EmberAddon._addonTree (/Users/alvincrespo/workspace/fly-blankslate/node_modules/ember-cli/lib/broccoli/ember-app.js:597:38) ➜ fly-blankslate git:(chore-ember-110)

我在插件中运行ember init并更新了bower.json和package.json:

的package.json

{ "name": "fly-blankslate", "version": "0.0.0", "description": "The default blueprint for ember-cli addons.", "directories": { "doc": "doc", "test": "tests" }, "scripts": { "start": "ember server", "build": "ember build", "test": "ember test" }, "repository": "", "engines": { "node": ">= 0.10.0" }, "author": "", "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.0.0", "ember-cli": "0.2.0-beta.1", "ember-cli-babel": "^4.0.0", "ember-cli-app-version": "0.3.1", "ember-cli-content-security-policy": "0.3.0", "ember-cli-dependency-checker": "0.0.7", "ember-cli-htmlbars": "0.7.4", "ember-cli-ic-ajax": "0.1.1", "ember-cli-inject-live-reload": "^1.3.0", "ember-cli-qunit": "0.3.8", "ember-cli-uglify": "1.0.1", "ember-data": "1.0.0-beta.15", "ember-export-application-global": "^1.0.2", "express": "^4.8.5", "glob": "^4.0.5" }, "keywords": [ "ember-addon" ], "ember-addon": { "configPath": "tests/dummy/config" } }

bower.json

{ "name": "fly-blankslate", "dependencies": { "jquery": "^1.11.1", "ember": "1.10.0", "ember-data": "1.0.0-beta.15", "ember-resolver": "~0.1.11", "loader.js": "ember-cli/loader.js#1.0.1", "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", "ember-qunit": "0.2.8", "ember-qunit-notifications": "0.0.7", "qunit": "~1.17.1", "fly-css-framework": "git@github.com:customerio/fly-css-framework.git" } }

有什么想法吗?我在制作新插件时也看到了这一点:

https://github.com/alvincrespo/test-templates

3 个答案:

答案 0 :(得分:3)

您需要在插件中安装ember-cli-htmlbars作为依赖项。进入插件目录并输入以下内容:

npm install --save ember-cli-htmlbars

或者,您可以打开package.json,在ember-cli-htmlbars下找到devDependencies依赖关系,并在<{1}}下找到复制。< / p>

答案 1 :(得分:0)

Ember 1.10 以上,我认为您需要的模板处理器可能是: ember-template-compiler.js

请参阅此博文:http://emberjs.com/blog/2015/02/05/compiling-templates-in-1-10-0.html

将您的代码移动到jsbin并添加它,看它是否运行。

  <script src="http://builds.emberjs.com/beta/ember-template-compiler.js"></script>

答案 2 :(得分:0)

打开项目文件夹中的/node_modules/ember-cli/lib/preprocessors.js文件。 现在将broccoli-ember-hbs-template-compiler替换为ember-cli-htmlbars

如果您以某种方式删除/node_modules/ember-cli文件夹,则会再次执行此操作。

希望它有所帮助。