java - jHipster 生产构建错误。无法运行任务: 'yarn run webpack:prod' failed

标签 java npm jhipster

我使用 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 64位

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

3)数据库postgase

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,如果需要,请更新它。然后再试一次。它对我有用。

关于java - jHipster 生产构建错误。无法运行任务: 'yarn run webpack:prod' failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47789417/

相关文章:

java - com.twilio.sdk.TwilioRestException : The 'To' number +? ????????????不是有效的电话号码

java - 如何将方法转换为泛型方法?

java - 如何将对象数组添加到列表中

linux - 使用 npm 安装后找不到命令

azure - "Move it away"部署到 Azure 时出现 NPM 错误

java - 使用Throwable进行异常以外的操作

javascript - npm 恢复并发布旧的 npm 包

spring - 使用 Jhipster 连接到 Mysql

css - 如何用JHipster修改CSS样式?

java - 设置 JSESSIONID cookie 的 SameSite 属性 - JHipster 应用程序