从Ember version 2.11开始,应该可以从bower中删除ember,而是使用npm ember-source
模块加载库。
我已经npm install --save-dev ember-source
了。我已从ember
文件中删除bower.json
,然后运行rm -rf bower_components/ember
。
我已将ember-source
添加到packages.json
并安装了它。
当我运行ember serve
时,它会显示以下消息:
Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
Error: Cannot find module 'path/to/myapp/bower_components/ember/ember-template-compiler'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Class.included (path/to/myapp/node_modules/ember-cli-htmlbars-inline-precompile/index.js:48:20)
at Class.superWrapper [as included] (path/to/myapp/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:34:20)
at EmberApp.<anonymous> (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:495:15)
at Array.filter (native)
at EmberApp._notifyAddonIncluded (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:490:45)
at new EmberApp (path/to/myapp/node_modules/ember-cli/lib/broccoli/ember-app.js:140:8)
看起来ember试图从不再存在的bower模块加载ember-template-compiler
。我怎么能告诉ember它应该寻找node_modules/ember-source/dist/ember-template-compiler.js
?
答案 0 :(得分:1)
尝试在package.json
中更新它 "ember-cli-htmlbars-inline-precompile": "^0.3.6"