小编Mal*_*thy的帖子

ng 测试和 ng 服务失败,并显示“发生未处理的异常:无效或意外的令牌”

在我的 Angular8 应用程序中,直到昨天,ngserve 和 ngtest 都工作正常。但今天,两个命令都因错误而失败。

\n\n
An unhandled exception occurred: Invalid or unexpected token See "C:\\Users\\Username\\AppData\\Local\\Temp\\ng-jcwQWX\\angular-errors.log" for further details.\n
Run Code Online (Sandbox Code Playgroud)\n\n

角度错误.log 文件

\n\n
[error] C:\\Users\\Username\\Documents\\GWM\\GWM-Front-end\\node_modules\\webpack\\lib\\node\\NodeMainTemplatePlugin.js:2\n\n\n\nSyntaxError: Invalid or unexpected token\n    at compileFunction (<anonymous>)\n    at Module._compile (internal/modules/cjs/loader.js:892:18)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n    at Module.load (internal/modules/cjs/loader.js:812:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n    at Module.require (internal/modules/cjs/loader.js:849:19)\n    at require (internal/modules/cjs/helpers.js:74:18)\n    at Object.<anonymous> (C:\\Users\\Username\\Documents\\GWM\\GWM-Front-end\\node_modules\\webpack\\lib\\node\\NodeTemplatePlugin.js:8:32)\n    at Module._compile (internal/modules/cjs/loader.js:956:30)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)\n    at Module.load (internal/modules/cjs/loader.js:812:32)\n    at Function.Module._load (internal/modules/cjs/loader.js:724:14)\n    at Module.require (internal/modules/cjs/loader.js:849:19)\n    at require (internal/modules/cjs/helpers.js:74:18)\n    at Object.<anonymous> (C:\\Users\\Username\\Documents\\GWM\\GWM-Front-end\\node_modules\\@ngtools\\webpack\\src\\resource_loader.js:16:28)\n    at Module._compile (internal/modules/cjs/loader.js:958:30)\n
Run Code Online (Sandbox Code Playgroud)\n\n

当我尝试 …

angular

5
推荐指数
1
解决办法
8004
查看次数

标签 统计

angular ×1