找不到“”;应用程序“;模板或视图.对象{fullName:“template:application”}将不呈现任何内

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

本文关键字:application template 任何内 应用程序 视图 找不到 对象 fullName      更新时间:2023-09-26

我最近将一个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中运行良好,但正如文档所说https://ember-cli.com/user-guide/#upgrading:

对于Windows,请使用此命令。

rd /s /q node_modules bower_components dist tmp