Angular2: ngModule, BrowserModule, FormsModule are not exported members

As Kim Phung stated, this is because a new RC of Angular was just released. Change the following lines in packages.json:

// ...snip...
"dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",

// ...file continues...

Then run, in your console:

npm update

Good to go!


Some modules just get added to the new version of Angular, so if you are not updating, you can not import it.

After about half an hour of search, got a solution:

Create a new folder and cd to your folder.

In command line, Type:

 git clone  https://github.com/angular/quickstart
 cd quickstart
 npm install

And copy your old code to the newly created project

Tags:

Angular