ng 构建抛出 "ERROR in Cannot read property 'kind' of undefined"

ng build throws "ERROR in Cannot read property 'kind' of undefined"

所以我有一个正在进行的项目需要我使用 ng build --prod 来构建客户端。当我 运行 ng build --prod 我每次都得到同样的错误:

ERROR in Cannot read property 'kind' of undefined

这个错误每次都会发生,无论我做什么,经过将近一周的努力和寻找解决方案的几天后,我似乎无法让客户端正确构建。我已将 git link 附加到客户端,希望有人能够找到并修复此错误。要 运行 这个,只需 npm install 在你下载它的位置的 Cube 文件夹中,然后 运行 ng build --prod。我希望这是一个简单的修复。

Githublink安装客户端:

https://github.com/detis46901/Cube.git

编辑 1: 我查看了 Whosebug 上的其他问题,例如下面评论中列出的问题 (TypeError: Cannot read property 'kind' of undefined at getAssignmentTargetKind)。这些解决方案似乎不起作用。

所以我找到了解决方案。我不得不进去编辑 tsconfig.json.

"angularCompilerOptions" 下我不得不添加 "enableIvy": false

"lib" 下,我不得不添加 "ES2020" 以及 "ESNext"

完成后,我需要 rm ./node_modules/ 然后 npm i。然后,我必须安装特定版本的打字稿和 angular.

npm install typescript@3.6
npm install @angular-devkit/built-angular@0.901.9
npm install @angular/core@9.1.4 @angular/animations@9.1.4 @angular/common@9.1.4 @angular/forms@9.1.4 @angular/platform-browser@9.1.4 @angular/router@9.1.4 @angular/platform-browser-dynamic@9.1.4 @angular/compiler@9.1.4 @angular/compiler-cli@9.1.4 @angular/language-service@9.1.4

通过这些更改,我终于可以 ng build 客户端了。我会让原来的 github 所有者知道需要更改什么,以便可以更好地使用该程序。