Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 找不到“;申请书;模板或视图。不会呈现任何对象{fullName:“template:application”}_Javascript_Ember.js_Handlebars.js_Ember Cli - Fatal编程技术网

Javascript 找不到“;申请书;模板或视图。不会呈现任何对象{fullName:“template:application”}

Javascript 找不到“;申请书;模板或视图。不会呈现任何对象{fullName:“template:application”},javascript,ember.js,handlebars.js,ember-cli,Javascript,Ember.js,Handlebars.js,Ember Cli,我最近将一个ember cli项目从0.0.44更新为0.1.1,突然我的模板不再加载,而在控制台上收到以下警告: Could not find "application" template or view. Nothing will be rendered Object {fullName: "template:application"} Could not find "index" template or view. Nothing will be rendered Object {ful

我最近将一个
ember cli
项目从
0.0.44
更新为
0.1.1
,突然我的模板不再加载,而在控制台上收到以下警告:

Could not find "application" template or view. Nothing will be rendered Object {fullName: "template:application"}

Could not find "index" template or view. Nothing will be rendered Object {fullName: "template:index"}
我更新项目的步骤是:

npm install --save-dev ember-cli
ember init
这是我的路由器:

import Ember from 'ember';
import config from './config/environment';

var Router = Ember.Router.extend({
  location: config.locationType
});

Router.map(function() {
  this.route('login');
  this.route('permission');
  this.route('user');
  this.route('room');
  this.route('room/new');
});

Router.reopen({
  notifyGoogleAnalytics: function() {
    return window.ga('send', 'pageview', {
      'page': this.get('url'),
      'title': this.get('url')
    });
  }.on('didTransition')
});

export default Router;
这是我的
app.js

import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import config from './config/environment';

Ember.MODEL_FACTORY_INJECTIONS = true;

var App = Ember.Application.extend({
  modulePrefix: config.modulePrefix,
  autoprefixer: {
    browsers: ['> 1%', 'last 1 version', 'android 4', 'ios 6']
  },
  podModulePrefix: config.podModulePrefix,
  Resolver: Resolver
});

loadInitializers(App, config.modulePrefix);

export default App;
有什么帮助吗?

这应该有帮助:

npm cache clear
bower cache clean
rm -rf dist tmp bower_components node_modules
npm install
bower install

我不得不说,我尝试了@quaertym解决方案,它给我带来了很多问题。对于其他人,此命令可能会有所帮助:

rm -rf dist tmp bower_components node_modules
在OSX和Linux中工作得很好,但正如文档所述:

对于Windows,请使用此命令

rd /s /q node_modules bower_components dist tmp

@未定义它显然是因为它不在那个位置。我用一个新安装测试了它,从0.0.44更新到0.1.1,它工作了,所以我将两者进行比较,看看哪里不合适。路由应用程序索引是什么?你的模板在哪个目录下,你能提供所有信息吗:)我在问题中添加了我的
route.js
文件,我的模板在
app/templates/
中,都以.hbs命名,
application.hbs
index.hbs
都在那里。我正在使用
ember-simple auth
也不知道它为什么有效,但这节省了我一些时间。将其添加到文档中可能是个好主意。谢谢您。省去了我很多头痛!