No Exported Member / Node Modules

前端 未结 5 1072
春和景丽
春和景丽 2021-02-13 06:22

I am just starting Angular 2 / Typescript using the 5 Minute Quickstart found here. I\'ve run into what looks to be a common problem, but maybe a bit different. I am encounter

5条回答
  •  没有蜡笔的小新
    2021-02-13 06:32

    please update all your @angular dependencies in package.json to at least "2.0.0-rc.5"

    after that verify your application bootstrap in main.ts.

    according to changelog of 2.0.0-rc.5 there is a change of bootstrap your app. or see also updated tutorial guide https://angular.io/guide/quickstart.

    import {NgModule} from '@angular/core';
    
    @NgModule({
      declarations: […], // directives, components, and pipes owned by this NgModule
      imports: [BrowserModule],
      providers: […], // additional providers
      bootstrap: [MainComponent],
    })
    class MyAppModule {}
    
    // Ahead of Time compile
    import {platformBrowser} from ‘@angular/platform-browser’;
    
    platformBrowser().bootstrapModuleFactory(MyAppModuleNgFactory);
    
    // JIT compile long form
    import {platformBrowserDynamic} from ‘@angular/platform-browser-dynamic’;
    
    platformBrowserDynamic().bootstrapModule(MyAppModule);
    

提交回复
热议问题