eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 868 forks source link

Can't build example project on maven:3.6.0-jdk-8-alpine #1111

Open breadnarz opened 9 months ago

breadnarz commented 9 months ago

I'm trying to use the maven:3.6.0-jdk-8-alpine image to build the example project. I'm getting the following error:

[INFO] Running 'npm ci' in /tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project [DEBUG] Executing command line [/tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project/node/node, /tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project/node/node_modules/npm/bin/npm-cli.js, ci] [INFO] Error relocating /tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project/node/node: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found [INFO] Error relocating /tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project/node/node: _ZNSt19_Sp_make_shared_tag5_S_eqERKSt9type_info: symbol not found [INFO] Error relocating /tmp/frontend-maven-plugin/frontend-maven-plugin/src/it/example project/node/node: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.770 s [INFO] Finished at: 2023-09-28T15:45:47Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm ci) on project example: Failed to run task: 'npm ci' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127) -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:npm (npm ci) on project example: Failed to run task

Should I be able to build this example project on that image? From reading the readme it seems like both maven and jdk requirements are met.

neoxpert commented 8 months ago

Not a problem of the frontend maven plugin. Looks like you are using an incompatible NodeJS executable. Googling for the report error yields several results related to running NodeJS on Alpine Linux.

https://stackoverflow.com/questions/71983169/error-relocating-usr-bin-node-znst7-cxx1119basic-ostringstreamicst11char-tra https://github.com/nodejs/node/issues/41058

To fix this issue, you have to use a NodeJS version that is compatible with the Alpine Linux version of the chosen docker image.