【问题标题】:jHipster production build error. Failed to run task: 'yarn run webpack:prod' failedjHipster 生产构建错误。无法运行任务:'yarn run webpack:prod' 失败
【发布时间】:2018-05-27 03:07:15
【问题描述】:

我使用 jHipster 4.9.0 生成了单体应用程序,当我运行 mvn -Pprod package 时,构建失败并出现以下错误.

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (webpack build prod) on project itob-p: 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]

我还重新安装了包含 npm 包 5.3.0 的 Nodejs,还删除了文件夹 node_modules 并在生成的文件夹上重新安装了 npm,但没有成功。如果我做错了什么,我被卡住并且无法识别问题,请指出。

到目前为止做了什么:

1) 操作系统 = Windows 7 64bit

2) 生成的非政治应用源码[yo jhipster]

3) 数据库postgrase

4) OAuth2

5) mvn -Pprod 包

6) 在 [Dev] 模式下成功部署在 Pivotal Cloud Foundry 上

请注意,在为生产进行构建时会出现此问题。

这里是这个命令的完整堆栈。 我无法识别和理解问题。请帮助我,如果您有任何建议,请分享。
这是完整的错误堆栈。

[INFO]
[INFO] --- frontend-maven-plugin:1.6:yarn (webpack build prod) @ itob-p ---
[INFO] Running 'yarn run webpack:prod' in C:\Users\hassnan.ali\Desktop\del.me\postgres2
[INFO] yarn run v1.1.0
[INFO] $ yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www
[ERROR] warning From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarde
d as-is to the scripts.
[INFO] Starting compilation using the angular compiler.
[ERROR] (node:7220) DeprecationWarning: Chunk.modules is deprecated. Use     Chunk.getNumberOfModules/mapModules/forEachModule/containsModule instead.
[INFO] Angular compilation done, starting webpack bundling.
[ERROR] TypeError: Cannot read property 'flags' of undefined
[ERROR]     at checkUnreachable     (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescrip
t.js:20770:30)
[ERROR]     at bindChildrenWorker     (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-    wrapped\node_modules\typescript\lib\typescript.js:19014:17)
[ERROR]     at bindChildren (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js
:18969:17)
[ERROR]     at bind (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.js:20199:2
1)
[ERROR]     at bindSourceFile (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\typescript.
js:18588:17)
[ERROR]     at Object.bindSourceFile (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\type
script.js:18539:9)
[ERROR]     at initializeTypeChecker (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\type
script.js:44253:20)
[ERROR]     at Object.createTypeChecker (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\lib\t
ypescript.js:23058:9)
[ERROR]     at getDiagnosticsProducingTypeChecker (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typesc
ript\lib\typescript.js:70194:93)
[ERROR]     at Object.getGlobalDiagnostics (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\node_modules\typescript\li
b\typescript.js:70570:53)
[ERROR]     at Tsc.typeCheck (C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-    wrapped\src\tsc.js:166:23)
[ERROR]     at C:\Users\hassnan.ali\Desktop\del.me\postgres2\node_modules\@angular\tsc-wrapped\src\main.js:122:23
[ERROR]     at process._tickCallback (internal/process/next_tick.js:109:7)
[ERROR] error Command failed with exit code 1.
[ERROR] error Command failed with exit code 1.
[ERROR] error Command failed with exit code 1.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation     about this command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13:43 min
[INFO] Finished at: 2017-12-13T13:08:13+05:00
[INFO] Final Memory: 30M/208M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (webpack build prod) on project itob-p: Failed to run task: 'yarn ru
n 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 使用npm。你也在安装吗?
  • @canillas yarn 已经安装并且工作正常。
  • 但是npm 安装了吗?
  • @canillas 是的,它已安装。
  • 您是否尝试过使用jhipster upgradecommand 进行升级?

标签: java npm jhipster


【解决方案1】:

只需运行yarn,如果需要,请更新它。然后再试一次。它对我有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-02
    • 2018-04-09
    • 1970-01-01
    • 1970-01-01
    • 2019-03-28
    • 1970-01-01
    相关资源
    最近更新 更多