如何在命令行中跟踪和调试Angular 2?

时间:2017-02-13 03:49:31

标签: angular debugging typescript command-line

我有一个应用程序,其代码我没有触及约2周。它以前运行得很好。

但是现在当我尝试运行ng serve时,Angular抱怨Unexpected token。我遇到的问题是试图追踪错误的来源。命令行不向我指示错误的行(或至少是文件)源。

我错过了什么吗?

这是输出:

Unexpected token {
SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\@ngtools\webpack\src\index.js:5:10)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\models\webpack-build-typescript.js:3:17)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\models\webpack-config.js:2:34)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\tasks\build-webpack.js:6:24)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\commands\build.js:4:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Class.module.exports.includedCommands (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\addon\index.js:21:16)
    at C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\ember-cli\lib\models\project.js:335:61
    at Array.forEach (native)
    at Project.addonCommands (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\ember-cli\lib\models\project.js:334:15)
    at Project.eachAddonCommand (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\ember-cli\lib\models\project.js:369:30)
    at module.exports (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\ember-cli\lib\cli\lookup-command.js:33:13)
    at CLI.<anonymous> (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\angular-cli\ember-cli\lib\cli\cli.js:43:26)
    at tryCatch (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\rsvp\dist\rsvp.js:538:12)
    at invokeCallback (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\rsvp\dist\rsvp.js:553:13)
    at publish (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\rsvp\dist\rsvp.js:521:7)
    at flush (C:\wamp64\www\udemy_angular_2\recipe-book\node_modules\rsvp\dist\rsvp.js:2373:5)
    at _combinedTickCallback (node.js:376:9)
    at process._tickCallback (node.js:407:11)

0 个答案:

没有答案