在生产中编译时错误构建jhipster

时间:2019-04-18 18:32:21

标签: java angular spring npm

在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

1 个答案:

答案 0 :(得分:0)

有一行说明在Angular应用程序的npm构建期间发生的错误

[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.

尝试解决该问题,它应该可以编译,否则至少会收到另一个错误

相关问题