'内部错误:未知标识符'使用-aot构建角度项目时

时间:2018-06-02 17:49:55

标签: angular npm

当我使用ng build -prod -aot = false构建我的角度应用程序时,它可以正常工作。但是,当我使用它时它会引发以下错误

  

错误输入:错误:内部错误:未知标识符   [{"文件路径":" C:/Users/Ab/Documents/IE-Tech/EPMA/zenith_epma/Client/EPMAWEB/node_modules/@angular/core/core.d.ts" ;,"名称":"的ErrorHandler""会员":[]}]       at Object.importExpr $$ 1 [as importExpr](C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:31048:23 )       at tokenExpr(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:20049:39)       at providerDef(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:19952:20)       在C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:20174:77       在Array.map()       在NgModuleCompiler.compile(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:20174:44)       在AotCompiler._compileModule(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:30941:32)       在C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:30823:66       在Array.forEach()       在AotCompiler._compileImplFile(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:30823:19)       在C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:30794:26       在Array.map()       在AotCompiler.emitAllImpls(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler \ bundles \ compiler.umd.js:30793:52)       在AngularCompilerProgram.generateFilesForEmit(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler-cli \ src \ transformers \ program.js:506:42)       在AngularCompilerProgram.emit(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @angular \ compiler-cli \ src \ transformers \ program.js:173:23)       在AngularCompilerPlugin._emit(C:\ Users \ Ab \ Documents \ IE-Tech \ EPMA \ zenith_epma \ Client \ EPMAWEB \ node_modules \ @ngtools \ webpack \ src \ angular_compiler_plugin.js:770:49)

我已经尝试过npm update,降级和升级我的cli在1.7.3和1.6.8之间,但它返回相同的错误,除非我没有aot构建。我需要aot,因为它提供的速度和性能增强,它使捆绑文件比常规版本小很多。请在下面找到我的角度cli版本

Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64

0 个答案:

没有答案