view raw
Kha Tran Kha Tran - 9 months ago 1148
AngularJS Question

Angular2: ngModule, BrowserModule, FormsModule are not exported members

I am going through the Angular2 tutorial at All good to step Routing. Visual Studio Code shows the error at first 03 lines:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';


Module '"c:/Users/ktran/Source/Repos/angular2-quickstart-ts/node_modules/@angular/core/index"' has no exported member 'NgModule'.

folder node_modules:

enter image description here

any idea please?


Some module just add to the new version of Angular, so if you not update, you can not import it.

After 30 minutes search, my solution:

Create a new folder, go to your folder.

In command line, Type:

 git clone
 cd quickstart
 npm install

And copy your old code to the new create project