Typescript : Uncaught SyntaxError: Unexpected token
<p>I am trying to setup Angular2 with Typescript and ASP.NET Core. Here is package.json :</p>

<pre><code>{
  "name": "testappuit",
  "version": "1.0.0",
  "license": "ISC",
  "dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/compiler-cli": "0.6.0",
    "@angular/core": "2.0.0-rc.6",
    "@angular/forms": "2.0.0-rc.6",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.6",
    "core-js": "^2.4.1",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.11",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.17",
    "bootstrap": "^3.3.6"
  },
  "devDependencies": {
    "typescript": "^1.8.10",
    "typings":"^1.3.2"
  }
}
</code></pre>

<p>and tsconfig.json</p>

<pre><code>{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "../wwwroot/app"
  },
  "exclude": [
    "node_modules",
    "wwwroot"
  ]
}
</code></pre>

<p>and systemjs.config.js</p>

<pre><code>(function (global) {
    System.config({
        paths: {
            'npm:': 'node_modules/'
        },
        map: {
            app: 'app',
            '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
            '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
            '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
            '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
            '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
            '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
            '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
            '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
            'rxjs': 'npm:rxjs',
            'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
        },
    packages: {
                app: {
                    main: './main.js',
                    defaultExtension: 'js'
                },
                rxjs: {
                    defaultExtension: 'js'
                },
                'angular2-in-memory-web-api': {
                    main: './index.js',
                    defaultExtension: 'js'
                }
            }
        });
    })(this);
</code></pre>

<p>and app.component.ts :</p>

<pre><code>import { Component } from '@angular/core';
@Component({
    selector: 'my-app',
    template: '&lt;h1&gt;My First Angular 2 App&lt;/h1&gt;'
})
export class AppComponent { }
</code></pre>

<p>app.module.ts:</p>

<pre><code>import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent }   from './app.component';
@NgModule({
    imports: [BrowserModule],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule { }
</code></pre>

<p>and main.ts</p>

<pre><code>/// &lt;reference path="../../typings/globals/core-js/index.d.ts" /&gt;
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
</code></pre>

<p>index.html:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Angular 2 QuickStart&lt;/title&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="styles.css"&gt;
    &lt;!-- 1. Load libraries --&gt;
    &lt;!-- Polyfill(s) for older browsers --&gt;
    &lt;script src="node_modules/core-js/client/shim.min.js"&gt;&lt;/script&gt;
    &lt;script src="node_modules/zone.js/dist/zone.js"&gt;&lt;/script&gt;
    &lt;script src="node_modules/reflect-metadata/Reflect.js"&gt;&lt;/script&gt;
    &lt;script src="node_modules/systemjs/dist/system.src.js"&gt;&lt;/script&gt;
    &lt;!-- 2. Configure SystemJS --&gt;
    &lt;script src="systemjs.config.js"&gt;&lt;/script&gt;
    &lt;script&gt;
      System.import('app/main').catch(function(err){ console.error(err); });
    &lt;/script&gt;
&lt;/head&gt;
&lt;!-- 3. Display the application --&gt;
&lt;body&gt;
    &lt;my-app&gt;Loading...&lt;/my-app&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>here is the project structure:
<a href="https://i.stack.imgur.com/rXXsM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rXXsM.png" alt="enter image description here"></a></p>

<p>if i try to run it in the browser i keep getting </p>

<blockquote>
  <p>Uncaught SyntaxError: Unexpected token  Uncaught ReferenceError:
  System is not defined</p>
</blockquote>

<p>Help me to figure out the solution.</p>