Kha Tran Kha Tran - 1 year ago 1478
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?

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download