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

时间:2017-12-13 09:19:05

标签: java npm jhipster

我使用 jHipster 4.9.0 生成单一应用程序,当我运行 mvn -Pprod软件包时,构建失败并出现以下错误。

[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)数据库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

1 个答案:

答案 0 :(得分:0)

只需运行yarn,并在需要时对其进行更新。然后再试一次。它对我有用。