我是一名学生,在Angular的每个部分都非常新。 我正在建立一个非常简单的网站。 当我进行ng build时,它可以工作,但是ng build --prod给出错误
我尝试了ng update @ angular / cli @ angular / core。 我删除了所有服务 那并没有解决问题。
这些是我在角度cli中得到的错误
ng build --prod
...
...
...
ERROR in : Error: Internal error: unknown identifier [{"filePath":"C:/Users/user/source/repos/Angular/matanyaDayfani/node_modules/@angular/common/common.d.ts","name":"LocationStrategy","members":[]}]
at Object.importExpr$$1 [as importExpr] (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24170:27)
at tokenExpr (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:19863:43)
at providerDef (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:19789:24)
at C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:19959:81
at Array.map (<anonymous>)
at NgModuleCompiler.compile (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:19959:48)
at AotCompiler._compileModule (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24115:36)
at C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24034:70
at Array.forEach (<anonymous>)
at AotCompiler._compileImplFile (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24034:23)
at C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24024:74
at Array.map (<anonymous>)
at AotCompiler.emitAllImpls (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler\bundles\compiler.umd.js:24024:39)
at AngularCompilerProgram.generateFilesForEmit (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler-cli\src\transformers\program.js:620:46)
at AngularCompilerProgram._emitRender2 (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler-cli\src\transformers\program.js:266:47)
at AngularCompilerProgram.emit (C:\Users\user\source\repos\Angular\matanyaDayfani\node_modules\@angular\compiler-cli\src\transformers\program.js:201:22)
在图片中,您可以看到package.json文件从开始到现在的变化