首页 > 解决方案 > 构建 webpack 时出错 yarn run webpack:prod

问题描述

在 jhipster 中为网关构建生产版本时出现错误。

用于生产构建的命令是:./mvnw -Pprod package

我正进入(状态

  Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (webpack build prod) on project wvgateway: Failed to run task: 'yarn run webpack:prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

因此,按照上面的命令,我使用yarn run webpack:prod来构建 webpack 生产版本,但出现错误

ERROR in ./src/main/webapp/app/app.main.ts
 Module not found: Error: Can't resolve './app.module.ngfactory' in '/home/kellhydcpu160/Documents/TestDeployment/optima_gateway/src/main/webapp/app'
 @ ./src/main/webapp/app/app.main.ts 2:0-62
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
 error Command failed with exit code 1.
 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

标签: angularwebpackjhipster

解决方案


推荐阅读