簡體   English   中英

在生產中編譯時出錯構建jhipster

[英]error build jhipster when compile in production

在java angular應用程序中,當我使用命令編譯時

mvnw -Pprod
mvnw -Pprod package

它給了我以下錯誤,我不明白我是如何解決它們的。 我想在生產環境中使用它。

這是出現的編譯錯誤日志

[INFO] [52, 17]: Identifier 'fileURL' is never reassigned; use 'const' instead of 'var'.
[INFO]
[INFO]
[INFO] WARNING in ./src/main/webapp/app/core/storico/storico.service.ts
[INFO] Module Warning (from ./node_modules/tslint-loader/index.js):
[INFO] [26, 11]: comment must start with a space
[INFO] [34, 11]: comment must start with a space
[INFO] [28, 13]: Identifier 'data' is never reassigned; use 'const' instead of 'let'.
[INFO] [36, 13]: Identifier 'data' is never reassigned; use 'const' instead of 'let'.
[INFO]
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (webpack build prod) @ sagriamo ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm run webpack:prod' in H:\Programmazione\sagriamo
[INFO]
[INFO] > sagriamo@0.0.0 webpack:prod H:\Programmazione\sagriamo
[INFO] > npm run cleanup && npm run webpack:prod:main && npm run clean-www
[INFO]
[INFO]
[INFO] > sagriamo@0.0.0 cleanup H:\Programmazione\sagriamo
[INFO] > rimraf target/{aot,www}
[INFO]
[INFO]
[INFO] > sagriamo@0.0.0 webpack:prod:main H:\Programmazione\sagriamo
[INFO] > npm run webpack -- --config webpack/webpack.prod.js --profile
[INFO]
[INFO]
[INFO] > sagriamo@0.0.0 webpack H:\Programmazione\sagriamo
[INFO] > node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"
[INFO]
[ERROR] (node:11148) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
[INFO] Hash: e069b2f0aaa5bf9152de
[INFO] Version: webpack 4.29.0
[INFO] Time: 12503ms
[INFO] Built at: 2019-04-18 19:43:36
[INFO]  6 assets
[INFO] Entrypoint polyfills = app/polyfills.e069b2f0aaa5bf9152de.bundle.js
[INFO] Entrypoint global = global.8cfadacceac75d18abda.css app/global.e069b2f0aaa5bf9152de.bundle.js
[INFO] Entrypoint main = app/main.e069b2f0aaa5bf9152de.bundle.js
[INFO] [0] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
[INFO]     factory:6917ms building:4314ms = 11231ms
[INFO] [1] ./src/main/webapp/content/scss/global.scss 39 bytes {0} [built]
[INFO]     factory:6698ms building:5040ms = 11738ms
[INFO] [2] ./src/main/webapp/app/app.main.ts 0 bytes {1} [built]
[INFO]     factory:6917ms building:4330ms = 11247ms
[INFO]     + 1 hidden module
[INFO]
[INFO] ERROR in src/main/webapp/app/account/cassa/cassa.component.ts(8,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
[INFO]
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 2
[ERROR] npm ERR! sagriamo@0.0.0 webpack: `node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.prod.js" "--profile"`
[ERROR] npm ERR! Exit status 2
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the sagriamo@0.0.0 webpack script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\Alessio\AppData\Roaming\npm-cache\_logs\2019-04-18T17_43_36_206Z-debug.log
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 2
[ERROR] npm ERR! sagriamo@0.0.0 webpack:prod:main: `npm run webpack -- --config webpack/webpack.prod.js --profile`
[ERROR] npm ERR! Exit status 2
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the sagriamo@0.0.0 webpack:prod:main script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\Alessio\AppData\Roaming\npm-cache\_logs\2019-04-18T17_43_36_254Z-debug.log
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 2
[ERROR] npm ERR! sagriamo@0.0.0 webpack:prod: `npm run cleanup && npm run webpack:prod:main && npm run clean-www`
[ERROR] npm ERR! Exit status 2
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the sagriamo@0.0.0 webpack:prod script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\Alessio\AppData\Roaming\npm-cache\_logs\2019-04-18T17_43_36_309Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:12 min
[INFO] Finished at: 2019-04-18T19:43:36+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (webpack build prod) on project sagriamo: Failed to run task: 'npm run webpack:prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2) -> [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 ab`enter code here`out the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

在你的Angular應用程序的npm構建期間,有一行說明ERROR

[INFO] ERROR in src/main/webapp/app/account/cassa/cassa.component.ts(8,1): error TS1202: Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.

嘗試修復它,它應該編譯,或者至少你會得到另一個錯誤

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM