1

更新私有 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:

包.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

4

3 回答 3

3

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

npm install --save ember-cli-htmlbars

或者,您可以打开package.json,找到下面的ember-cli-htmlbars依赖项devDependencies并将其复制到下面dependencies

于 2015-05-24T22:25:44.570 回答
0

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

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

希望能帮助到你。

于 2015-04-15T20:41:21.067 回答
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>
于 2015-02-21T20:47:50.247 回答