Ошибка сборки Jhipster в производственной среде - PullRequest
0 голосов
/ 06 ноября 2019

Я использую jhipster 5.7 и угловой 7

. Я могу построить свой проект в среде разработчика, используя

mvnw -Pdev

npm start

, но когда я пытаюсь протестировать производственную сборку, используя

mvnw -Pprod

или чтобы упаковать приложение в «производственную» WAR с использованием

mvnw -Pprod,war clean verify

Я получаю эту ошибку:

   INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ my-app ---
[INFO] Running 'npm install' in F:\workspace\MyApp
[WARNING] npm WARN @agm/core@1.0.0-beta.5 requires a peer of @angular/common@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @agm/core@1.0.0-beta.5 requires a peer of @angular/core@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @angular/animations@7.2.15 requires a peer of @angular/core@7.2.15 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @ng-bootstrap/ng-bootstrap@3.3.1 requires a peer of @angular/common@^6.1.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @ng-bootstrap/ng-bootstrap@3.3.1 requires a peer of @angular/core@^6.1.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @ng-bootstrap/ng-bootstrap@3.3.1 requires a peer of @angular/forms@^6.1.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-charts@9.0.0 requires a peer of @angular/cdk@6.x but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-charts@9.0.0 requires a peer of @angular/common@6.x but none is installed. You must install peer dependencies yourself.
[INFO] audited 49702 packages in 77.015s
[INFO] found 23 vulnerabilities (3 low, 6 moderate, 13 high, 1 critical)
[WARNING] npm WARN @swimlane/ngx-charts@9.0.0 requires a peer of @angular/core@6.x but none is installed. You must install peer dependencies yourself.
[INFO]   run `npm audit fix` to fix them, or `npm audit` for details
[WARNING] npm WARN @swimlane/ngx-charts@9.0.0 requires a peer of @angular/animations@6.x but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-charts@9.0.0 requires a peer of @angular/platform-browser@6.x but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-datatable@13.1.0 requires a peer of @angular/common@<7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-datatable@13.1.0 requires a peer of @angular/compiler@<7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-datatable@13.1.0 requires a peer of @angular/core@<7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-datatable@13.1.0 requires a peer of @angular/platform-browser@<7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN @swimlane/ngx-datatable@13.1.0 requires a peer of @angular/platform-browser-dynamic@<7.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-2-dropdown-multiselect@1.8.1 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-2-dropdown-multiselect@1.8.1 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-2-dropdown-multiselect@1.8.1 requires a peer of @angular/forms@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-in-memory-web-api@0.6.1 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-in-memory-web-api@0.6.1 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN angular-in-memory-web-api@0.6.1 requires a peer of @angular/http@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN mic-recorder-to-mp3@2.2.1 requires a peer of webrtc-adapter@^4.1.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ng-jhipster@0.5.6 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ng-jhipster@0.5.6 requires a peer of @angular/router@^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ng2-smart-table@1.3.5 requires a peer of @angular/common@^6.0.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ng2-smart-table@1.3.5 requires a peer of @angular/core@^6.0.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ng2-smart-table@1.3.5 requires a peer of @angular/forms@^6.0.1 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-chips@2.0.2 requires a peer of @angular/animations@^8.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-chips@2.0.2 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-chips@2.0.2 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-chips@2.0.2 requires a peer of @angular/forms@^8.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-chips@2.0.2 requires a peer of rxjs@~6.4.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-toastr@8.9.1 requires a peer of @angular/core@^5.2.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-toastr@8.9.1 requires a peer of @angular/common@^5.2.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-toastr@8.9.1 requires a peer of @angular/platform-browser@^5.2.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN ngx-webstorage@2.0.1 requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
[WARNING] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
[WARNING] npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
[ERROR]
[INFO]
[INFO] --- frontend-maven-plugin:1.6:npm (webpack build prod) @ taysir-app ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npm run webpack:prod' in F:\workspace\MyApp
[ERROR] npm ERR! missing script: webpack:prod
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR!     C:\Users\hp1\AppData\Roaming\npm-cache\_logs\2019-1-06T19_21_33_798Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:00 min
[INFO] Finished at: 2019-1-06T22:21:33+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (webpack build prod) on project taysir-app: Failed to run task: 'npm run 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

это отладка 2019-1-06T19_21_33_798Z. log

0 info it worked if it ends with ok
1 verbose cli [ 'F:\\workspace\\MyApp\\node\\node.exe',
1 verbose cli   'F:\\workspace\\MyApp\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'webpack:prod' ]
2 info using npm@6.4.1
3 info using node@v10.13.0
4 verbose stack Error: missing script: webpack:prod
4 verbose stack     at run (F:\workspace\MyApp\node\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack     at F:\workspace\MyApp\node\node_modules\npm\lib\run-script.js:63:5
4 verbose stack     at F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:115:5
4 verbose stack     at F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:418:5
4 verbose stack     at checkBinReferences_ (F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:373:45)
4 verbose stack     at final (F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:416:3)
4 verbose stack     at then (F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:160:5)
4 verbose stack     at F:\workspace\MyApp\node\node_modules\npm\node_modules\read-package-json\read-json.js:280:12
4 verbose stack     at F:\workspace\MyApp\node\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
4 verbose stack     at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd F:\workspace\MyApp
6 verbose Windows_NT 6.3.9600
7 verbose argv "F:\\workspace\\MyApp\\node\\node.exe" "F:\\workspace\\MyApp\\node\\node_modules\\npm\\bin\\npm-cli.js" "run" "webpack:prod"
8 verbose node v10.13.0
9 verbose npm  v6.4.1
10 error missing script: webpack:prod
11 verbose exit [ 1, true ]

это моя среда:

enter image description here

и это angular.json:

          {
  "name": "mayapp",
  "version": "2.4.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --proxy-config proxy.conf.json",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "1.0.0-beta.5",
    "@angular/animations": "^7.2.15",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "7.0.3",
    "@angular/compiler": "7.0.3",
    "@angular/core": "7.0.3",
    "@angular/forms": "7.0.3",
    "@angular/http": "7.0.3",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "7.0.3",
    "@angular/platform-browser-dynamic": "7.0.3",
    "@angular/router": "7.0.3",
    "@aspnet/signalr": "^1.1.4",
    "@fortawesome/angular-fontawesome": "0.3.0",
    "@fortawesome/fontawesome-svg-core": "1.2.8",
    "@fortawesome/free-brands-svg-icons": "^5.8.1",
    "@fortawesome/free-solid-svg-icons": "5.5.0",
    "@ng-bootstrap/ng-bootstrap": "3.3.1",
    "@swimlane/ngx-charts": "9.0.0",
    "@swimlane/ngx-datatable": "13.1.0",
    "@syncfusion/ej2-angular-dropdowns": "^17.2.34",
    "@types/dwt": "^15.1.0",
    "angular-2-dropdown-multiselect": "1.8.1",
    "angular-calendar": "0.25.2",
    "angular-in-memory-web-api": "0.6.1",
    "angular-resizable-element": "3.2.2",
    "bootstrap": "4.1.3",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.7",
    "d3": "5.7.0",
    "date-fns": "1.29.0",
    "dwt": "^15.1.1",
    "flag-icon-css": "3.2.1",
    "font-awesome": "4.7.0",
    "hijri-converter": "^1.1.1",
    "intl": "1.2.5",
    "jquery": "3.3.1",
    "leaflet-map": "0.2.1",
    "mic-recorder-to-mp3": "^2.2.1",
    "ng-chat": "^2.0.4",
    "ng-jhipster": "0.5.6",
    "ng2-ckeditor": "1.2.2",
    "ng2-completer": "2.0.8",
    "ng2-dragula": "2.1.1",
    "ng2-file-upload": "^1.3.0",
    "ng2-smart-table": "1.3.5",
    "ng2-validation": "4.2.0",
    "ngx-bootstrap": "^5.1.0",
    "ngx-chips": "^2.0.2",
    "ngx-cookie": "2.0.1",
    "ngx-doc-viewer": "^0.1.20",
    "ngx-dropzone-wrapper": "^8.0.0",
    "ngx-extended-pdf-viewer": "^1.6.1",
    "ngx-infinite-scroll": "6.0.1",
    "ngx-pagination": "3.2.1",
    "ngx-perfect-scrollbar": "6.3.1",
    "ngx-toastr": "8.9.1",
    "ngx-treeview": "^6.0.2",
    "ngx-webstorage": "^2.0.1",
    "popper.js": "1.14.4",
    "rxjs": "6.3.3",
    "rxjs-compat": "6.3.3",
    "speak-tts": "^2.0.8",
    "web-animations-js": "2.3.1",
    "widgster": "1.0.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.12.1",
    "@angular/cli": "^7.0.5",
    "@angular/compiler-cli": "7.0.3",
    "@angular/language-service": "7.0.3",
    "@types/jasmine": "2.8.9",
    "@types/jasminewd2": "2.0.5",
    "@types/node": "10.12.0",
    "angular-ide": "^0.9.52",
    "codelyzer": "4.5.0",
    "generator-jhipster": "5.7.0",
    "jasmine-core": "3.2.1",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "3.1.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage-istanbul-reporter": "2.0.4",
    "karma-jasmine": "1.1.2",
    "karma-jasmine-html-reporter": "1.3.1",
    "nodemon": "^1.19.2",
    "protractor": "5.4.1",
    "ts-node": "7.0.1",
    "tslint": "5.11.0",
    "typescript": "3.1.6"
  }
}

и это конфигурация в poom.xml

   <!-- Build properties -->
    <maven.version>3.0.0</maven.version>
    <java.version>1.8</java.version>
    <scala.version>2.12.6</scala.version>
    <node.version>v10.13.0</node.version>
    <npm.version>6.4.1</npm.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.testresult.directory>${project.build.directory}/test-results</project.testresult.directory>
    <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
    <m2e.apt.activation>jdt_apt</m2e.apt.activation>
    <run.addResources>false</run.addResources>
    <!-- These remain empty unless the corresponding profile is active -->
    <profile.no-liquibase/>
    <profile.swagger/>
    <profile.tls/>


      <execution>
                <id>webpack build test</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <arguments>run webpack:test</arguments>
                  <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
                </configuration>
              </execution>
              <execution>
                <id>webpack build prod</id>
                <goals>
                  <goal>npm</goal>
                </goals>
                <phase>generate-resources</phase>
                <configuration>
                  <arguments>run webpack:prod</arguments>
                  <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
                </configuration>
              </execution>
...