frontend-maven-plugin
frontend-maven-plugin copied to clipboard
npx MODULE_NOT_FOUND
I'm getting an error message on my new Mac M4. The same build works fine on WSL on my Windows machine.
[INFO] --- frontend:1.15.1:install-node-and-npm (install node and npm) @ linkeddatahub ---
[INFO] Node v20.8.1 is already installed.
[INFO]
[INFO] --- frontend:1.15.1:npx (generate-sef) @ linkeddatahub ---
[INFO] Running 'npx xslt3-he -t -xsl:/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/target/ROOT/static/com/atomgraph/linkeddatahub/xsl/client.xsl -export:/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/target/ROOT/static/com/atomgraph/linkeddatahub/xsl/client.xsl.sef.json -nogo -ns:##html5 -relocate:on' in /Users/Martynas.Jusevicius/WebRoot/LinkedDataHub
[INFO] node:internal/modules/cjs/loader:1051
[INFO] throw err;
[INFO] ^
[INFO]
[INFO] Error: Cannot find module '/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/node/node_modules/npm/bin/npx-cli.js'
[INFO] at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
[INFO] at Module._load (node:internal/modules/cjs/loader:901:27)
[INFO] at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
[INFO] at node:internal/main/run_main_module:23:47 {
[INFO] code: 'MODULE_NOT_FOUND',
[INFO] requireStack: []
[INFO] }
[INFO]
[INFO] Node.js v20.8.1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.921 s
[INFO] Finished at: 2025-04-18T14:00:20+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.1:npx (generate-sef) on project linkeddatahub: Failed to run task: 'npx xslt3-he -t -xsl:/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/target/ROOT/static/com/atomgraph/linkeddatahub/xsl/client.xsl -export:/Users/Martynas.Jusevicius/WebRoot/LinkedDataHub/target/ROOT/static/com/atomgraph/linkeddatahub/xsl/client.xsl.sef.json -nogo -ns:##html5 -relocate:on' 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
The POM fragment looks like this:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.1</version>
<configuration>
<nodeVersion>v20.8.1</nodeVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>package</phase>
</execution>
<execution>
<id>generate-sef</id>
<goals>
<goal>npx</goal>
</goals>
<phase>package</phase>
<configuration>
<arguments>xslt3-he -t -xsl:${project.build.directory}/${build.warName}${saxon-js.stylesheet} -export:${project.build.directory}/${build.warName}${saxon-js.stylesheet}.sef.json -nogo -ns:##html5 -relocate:on</arguments>
</configuration>
</execution>
</executions>
</plugin>