gpt4 book ai didi

angular-cli - NGCC 失败了。在 NgccProcessor.process ( Angular\node_modules\@ngtools\webpack\src\ngcc_processor.js :139:19)

转载 作者:行者123 更新时间:2023-12-05 02:39:58 25 4
gpt4 key购买 nike

我已将我的 Angular CLI 项目从 8 升级到 9。

这是当前的 Angular CLI 和其他包版本:

Angular CLI: 9.1.15
Node: 14.17.0
OS: win32 x64

Angular: 9.1.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1202.1
@angular-devkit/build-angular 12.2.1
@angular-devkit/build-optimizer 0.1202.1
@angular-devkit/build-webpack 0.1202.1
@angular-devkit/core 9.1.15
@angular-devkit/schematics 9.1.15
@angular/cdk 8.2.3
@angular/cli 9.1.15
@ngtools/webpack 12.2.1
@schematics/angular 9.1.15
@schematics/update 0.901.15
rxjs 6.6.7
typescript 3.8.3
webpack 5.50.0

我在编译项目时收到下面给出的错误。

Generating browser application bundles (phase: setup)...Options:
--version Show version number [boolean]
-s, --source A path (relative to the working
directory) of the `node_modules` folder
to process. [default: "./node_modules"]
-p, --properties An array of names of properties in
package.json to compile (e.g. `module`
or `es2015`)
Each of these properties should hold
the path to a bundle-format.
If provided, only the specified
properties are considered for
processing.
If not provided, all the supported
format properties (e.g. fesm2015,
fesm5, es2015, esm2015, esm5, main,
module) in the package.json are
considered.
.......
.......


Unknown arguments: use-program-dependencies, useProgramDependencies
C:\Users\x\Angular\node_modules\@ngtools\webpack\src\ngcc_processor.js:139
throw new Error(errorMessage + `NGCC failed${errorMessage ? ', see above' : ''}.`);

Error: NGCC failed.
at NgccProcessor.process (C:\Users\x\Angular\node_modules\@ngtools\webpack\src\ngcc_processor.js:139:19)
at C:\Users\x\Angular\node_modules\@ngtools\webpack\src\ivy\plugin.js:129:27

有人可以指导我如何解决这个问题吗?

最佳答案

运行此命令 npm i @ngtools/webpack 并在 @ 之后提及您想要的版本,与您的 Angular 版本相同。

npm i @ngtools/webpack@9.1.15

无论您使用哪个版本的 Angular,都选择相同的版本。

Version              Downloads (Last 7 Days)             Tag
12.2.14 101,188 v12-lts
8.3.29 60,775 v8-lts
9.1.15 57,568 v9-lts
7.3.10 34,584 v7-lts

你可以在这里找到所有的包@ngtools/webpack

关于angular-cli - NGCC 失败了。在 NgccProcessor.process ( Angular\node_modules\@ngtools\webpack\src\ngcc_processor.js :139:19),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68836949/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com