Expand my Community achievements bar.

SOLVED

Failed to execute goal com.github.eirslett:frontend-maven-plugin with AEM REact SPA

Avatar

Level 1

I have the following issue : 

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for wknd-spa-react 1.0.3-SNAPSHOT:
[INFO]
[INFO] wknd-spa-react ..................................... SUCCESS [ 0.508 s]
[INFO] WKND SPA React - Core .............................. SUCCESS [ 9.869 s]
[INFO] wknd-spa-react.ui.frontend - UI Frontend ........... FAILURE [ 21.494 s]
[INFO] WKND SPA React - Repository Structure Package ...... SKIPPED
[INFO] WKND SPA React - UI apps ........................... SKIPPED
[INFO] WKND SPA React - UI content ........................ SKIPPED
[INFO] WKND SPA React - All ............................... SKIPPED
[INFO] WKND SPA React - Integration Tests ................. SKIPPED
[INFO] WKND SPA React - Dispatcher ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.812 s
[INFO] Finished at: 2023-05-02T14:08:11-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm run build) on project wknd-spa-react.ui.frontend: Failed to run task: 'npm run build' 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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :wknd-spa-react.ui.frontend

 

This happens when I try to install the react app tutorial (github weekend spa branch React/latests2.0.0) but also when  I create a aem project with the archetype cli.

 

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.19.0-41-generic", arch: "amd64", family: "unix"

 

 

node v18.16.0

npm -v 9.5.1

 

Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hello, after verifying a lot of information and links, I understood the problem, then the analysis and solution.

Projects created with the AEM Project Archetype with Angular front end are completed with Angular version 9.
Below is the Nodejs compatibility table and angular version.

https://stackoverflow.com/questions/60248452/is-there-a-compatibility-list-for-angular-angular-cli-a...

For Angular 9 it should be Nodejs from 10.13.0 to ^12.11.1

Once the version change to Nodejs 11 is done, you must:

  • Enter the ui.frontend folder.
  • Delete node_modules folder.
  • Run "npm install "
  • Go back to the project's home folder and execute "mvn clean install -PautoInstallSinglePackage".

The issue is an incompatibility between versions due to the old version of angular for the AEM archetype.

View solution in original post

3 Replies

Avatar

Community Advisor

@user02634 - Firstly check if node.js is installed on you machine. Also try to run npm run build at ui.frontend module after deleting the node_modules.
If both things doesn't works then try to check if you have compatible node version installed.

Avatar

Level 1

it gives the following error 


Compiling @angular/common/testing : es2015 as esm2015
Compiling @angular/router/testing : es2015 as esm2015
10% building 4/5 modules 1 active /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/es5-polyfills.jsnode:internal/crypto/hash:71
this[kHandle] = new _Hash(algorithm, xofLen);
^

Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
at module.exports (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/NormalModule.js:417:16)
at /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/NormalModule.js:452:10
at /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/NormalModule.js:323:13
at /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:203:19
at VirtualFileSystemDecorator.readFile (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/@ngtools/webpack/src/virtual_file_system_decorator.js:46:13)
at processResource (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:202:11)
at iteratePitchingLoaders (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:158:10)
at runLoaders (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/loader-runner/lib/LoaderRunner.js:365:2)
at NormalModule.doBuild (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/NormalModule.js:295:3)
at NormalModule.build (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/NormalModule.js:446:15)
at Compilation.buildModule (/home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/Compilation.js:739:10)
at /home/aem-base/aem-projects/Adobe/aem-guides-wknd-spa.angular/ui.frontend/node_modules/webpack/lib/Compilation.js:981:14 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.16.0

Avatar

Correct answer by
Level 1

Hello, after verifying a lot of information and links, I understood the problem, then the analysis and solution.

Projects created with the AEM Project Archetype with Angular front end are completed with Angular version 9.
Below is the Nodejs compatibility table and angular version.

https://stackoverflow.com/questions/60248452/is-there-a-compatibility-list-for-angular-angular-cli-a...

For Angular 9 it should be Nodejs from 10.13.0 to ^12.11.1

Once the version change to Nodejs 11 is done, you must:

  • Enter the ui.frontend folder.
  • Delete node_modules folder.
  • Run "npm install "
  • Go back to the project's home folder and execute "mvn clean install -PautoInstallSinglePackage".

The issue is an incompatibility between versions due to the old version of angular for the AEM archetype.