如何 运行 ngcc 与 Angular 11/12

How to run ngcc with Angular 11/12

所以我们有一个 monorepo,它有两个使用 Angular 的不同项目。我们还有一个构建管道来自动化集成过程。我 运行 遇到的问题是 ngcc 不支持并行执行。我想在并行进程开始之前手动 运行 ngcc 命令,但我不知道如何找到?

该项目正在使用 Angular 11,我在全局安装了 @angular/cli@12.2.1,所以我希望 ngcc 成为那里工具的一部分,但到目前为止运气不好。我只是收到此错误:-bash: ngcc: command not found

万一有人想知道如果我只是尝试 运行 ng 并行构建,这就是我得到的错误:

ERROR in ngcc is already running at process with id 2113.
If you are running multiple builds in parallel then you might try pre-processing your node_modules via the command line ngcc tool before starting the builds.
(If you are sure no ngcc process is running then you should delete the lock-file at /Users/runner/work/1/s/frontend/apps/MY_APP/node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__.)

你能试试: npx ngcc -s path