启动angular 2应用程序后出现错误。导致错误的原因是什么?如何解决?当我在main.ts中需要@ angular / core时,它看起来就好了。
"SyntaxError: Unexpected token <
at eval (<anonymous>)
at SystemJSLoader.__exec (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:1506:18)
at entry.execute (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3647:16)
at linkDynamicModule (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3247:32)
at linkDynamicModule (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3241:11)
at getModule (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3215:9)
at http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3251:16
at require (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3888:29)
at Object.eval (http://localhost:5555/app/main.js:2:14)
at eval (http://localhost:5555/app/main.js:13:4)
at eval (http://localhost:5555/app/main.js:14:3)
at eval (<anonymous>)
at SystemJSLoader.__exec (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:1506:18)
at entry.execute (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3921:18)
at linkDynamicModule (http://localhost:5555/node_modules/systemjs/dist/system.src.js?1501265527981:3247:32)"
main.js
"use strict";
var core_1 = require('@angular/core');
var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
var app_config_1 = require('./app.config');
if (app_config_1.APP_CONFIG.ENV === 'prod') {
core_1.enableProdMode();
}
var app_module_1 = require('./app.module');
platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);
的package.json
...
"dependencies": {
"@angular/common": "^2.4.10",
"@angular/compiler": "^2.4.10",
"@angular/core": "^2.4.10",
"@angular/forms": "^2.4.10",
"@angular/http": "^2.4.10",
"@angular/platform-browser": "^2.4.10",
"@angular/platform-browser-dynamic": "^2.4.10",
"@angular/router": "^3.4.10",
...