首页 > 解决方案 > Angular 生产版本中的无效或意外令牌错误

问题描述

chunk {0} runtime.06daa30a2963fa413676.js, runtime.06daa30a2963fa413676.js.map (runtime) 1.5 kB [entry] [rendered]
chunk {1} main.9868d9b237c3a48c54da.js, main.9868d9b237c3a48c54da.js.map (main) 182 bytes [initial] [rendered]
chunk {2} polyfills.85f47f0bf59079cbc23a.js, polyfills.85f47f0bf59079cbc23a.js.map (polyfills) 189 bytes [initial] [rendered]
chunk {3} styles.da6a8dc1b4027cfd731e.css, styles.da6a8dc1b4027cfd731e.css.map (styles) 338 kB [initial] [rendered]

ERROR in Invalid or unexpected token

我收到上述错误消息

ng build --prod

在其他机器上,构建工作。此外,调试构建(ng serve)也可以工作。错误消息没有提供关于从哪里开始搜索的线索。此错误的原因是什么和/或如何识别它?

这是一些版本信息:

Angular CLI: 6.0.8
Node: 6.8.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.6.8
@angular-devkit/core         0.6.8
@angular-devkit/schematics   0.6.8
@schematics/angular          0.6.8
@schematics/update           0.6.8
rxjs                         6.2.1
typescript                   2.7.2

标签: angularangular-cli

解决方案


更新到当前版本的 node.js 解决了这个问题。


推荐阅读