No Exported Member / Node Modules

Blind Fish picture Blind Fish · Aug 11, 2016 · Viewed 30.9k times · Source

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 encountering all sorts of "No Exported Member" problems. Examples:

From app.module.ts:

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

Returns

...node_modules/@angular2/core/index" has no exported member 'NgModule'.

and

...@angular/platform-browser/index" has no exported member 'BrowserModule'.

And from main.ts:

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

throws:

...@angular/platform-browser-dynamic/index" has no exported member 'platformBrowserDynamic'.

I am running node version 4.4.7 and npm version 3.10.5.

I understand that these are probably resolvable in the context of the tutorial by rolling back node or npm to version relevant to the tutorial. I guess what I would prefer to have is an explanation of how to make the code from the tutorial relevant to the current versions of node.

ETA: These errors occur at compilation, not execution.

Answer

Sudhakar picture Sudhakar · Aug 17, 2016

For me it was VSCode editor issue. Simply reopening the editor resolved it