Angular 应用程序不再构建。找不到构建-long.md

Angular app is not building anymore. build-long.md was not found

对@angular-devkit/build-angular 包进行小幅更新后,构建脚本不再工作。当我使用 ng build app --base-href /app/ --output-path ./dist/app/de/ --deployUrl /en/app/ --configuration=dev 开始构建时,出现未处理的异常:

An unhandled exception occurred: File C:\Users\<User>\Projects\<project>\angular\node_modules\@angular\cli\commands\build-long.md was not found while constructing the subcommand build.

之后我升级到最新版本 9 并重新安装了完整的软件包,结果相同。我还更新了 @angular/cli@angular/compiler-cli,但没有任何改变。我删除了 node_modules 文件夹并重新安装了所有内容。问题依旧...

然后我将 @angular-devkit/build-angular 降级到 0.802.2. 版本(低于我们升级前使用的版本)并且完全相同的问题。

我查看了包裹,没有 build-long.md 文件。为什么会出现这个问题?有人可以帮忙吗?

终于找到问题了。 Yarn 在清理 node_modules 时会创建一个 .yarnclean 文件,并从已安装的包中排除 .md 文件。

所以我不得不从 yarnclean 文件中删除 .md 条目并重新安装所有包,它起作用了。

只需删除我的 node_modules 文件夹和 运行 npm i 再次为我工作。