简体   繁体   English

找不到模块“@ angular / core / src / metadata / directives”

[英]cannot find module “@angular/core/src/metadata/directives”

I am getting this error when trying to view my Ionic2 application. 我在尝试查看Ionic2应用程序时遇到此错误。 I have tried to implement a weather application within my application. 我试图在我的应用程序中实现天气应用程序。 I am unsure if this is causing an error. 我不确定这是否导致错误。

I am unsure where the error is coming from so I am unsure which code to post, so, please let me know if there is a certain part of code you need to see. 我不确定错误来自哪里,所以我不确定要发布哪个代码,所以,如果您需要查看某些代码,请告诉我。

cannot find module “@angular/core/src/metadata/directives” 找不到模块“@ angular / core / src / metadata / directives”

import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import firebase from 'firebase';
import { firebaseConfig } from './credentials';
import { HomePage } from '../pages/home/home';
import { Unsubscribe } from '@firebase/util';
import {MenuPage} from '../pages/menu/menu';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage: any;

  constructor(
    platform: Platform,
    statusBar: StatusBar,
    splashScreen: SplashScreen
  ) {
    firebase.initializeApp(firebaseConfig);

    const unsubscribe: Unsubscribe = firebase.auth().onAuthStateChanged(user => {
      if (user) {
        this.rootPage = HomePage;
        unsubscribe();
      } else {
        this.rootPage = 'LoginPage';
        unsubscribe();
      }
    });

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}

Deep imports are not supported as i mentioned in the comment above, Change 我在上面的评论中提到不支持Deep imports ,更改

From

import {Input} from '@angular/core/src/metadata/directives';

To

 import {Input} from '@angular/core';

Change the import to: 将导入更改为:

import {Input} from '@angular/core';

And the Restart the Application. 并重新启动应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM