无法找到模块“@angular-architects/module-federation/webpack”

问题描述 投票:0回答:1

我是 JHipster 的新手,并使用当前版本(迄今为止最新的 8.1.0)使用 JHipster 注册表和 Angular 微前端创建微服务应用程序。 创建后,当我尝试启动它(在 Windows cmd 上使用 mvnw 命令)时,构建失败并提示:
在一些文件中找不到模块“@angular-architects/module-federation/webpack”,如所附屏幕截图所示。 Build failure screenshot

我的 JHipster 注册表服务已启动并运行良好(在启动微服务应用程序之前)。 另外,我正在使用最新版本的 npm (9.8.1) 和 node (20.10.0)。 附加我在创建应用程序时使用的输入参数。 Input parameters screenshot

请帮助我了解我哪里出了问题(或)如何解决。

microservices jhipster
1个回答
0
投票

我遇到了与此论坛中的另一位用户相同的问题。目前,我使用的是 Node.js 版本 20,甚至当我切换到 Node.js 版本 18 时,我在构建过程中遇到以下错误:

[INFO] An unhandled exception occurred: Cannot find module '@angular-architects/module-federation/webpack'
[INFO] Require stack:
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/webpack/webpack.microfrontend.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/webpack/webpack.custom.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular-builders/custom-webpack/dist/utils.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular-builders/custom-webpack/dist/custom-webpack-builder.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular-builders/custom-webpack/dist/transform-factories.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular-builders/custom-webpack/dist/browser/index.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/src/command-builder/architect-base-command-module.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/src/command-builder/architect-command-module.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/src/commands/build/cli.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/src/commands/command-config.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/src/command-builder/command-runner.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/lib/cli/index.js
[INFO] - /home/kubjhib/Documents/k8ssandra/car-app/node_modules/@angular/cli/lib/init.js
[INFO] See "/tmp/ng-umSUzF/angular-errors.log" for further details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  27.732 s
[INFO] Finished at: 2023-12-18T12:08:08+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.0:npm (webapp build dev) on project carsapp: Failed to run task: 'npm run webapp:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127) -> [Help 1]

社区中有人有解决这个问题的方法吗?我已经尝试切换到 Node.js 版本 18,但错误仍然存在。对于如何找到此模块或解决此问题的其他方法有什么建议吗?

© www.soinside.com 2019 - 2024. All rights reserved.