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 867 forks source link

Bug report: Error: Cannot find module npx-cli.js #1096

Closed erwinc1 closed 1 year ago

erwinc1 commented 1 year ago

Do you want to request a feature or report a bug? Bug What is the current behavior? When I build my project using this pom.xml configuration, I get: Error: Cannot find module '/path-to-my-application/node/node_modules/npm/bin/npx-cli.js'

            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.13.4</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                    <execution>
                        <id>npx run</id>
                        <goals>
                            <goal>npx</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>cowsay hello</arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <nodeVersion>v4.6.0</nodeVersion>
                </configuration>
            </plugin>

If the current behavior is a bug, please provide the steps to reproduce. do mvn package and see the error What is the expected behavior? a cow saying hello Please mention your frontend-maven-plugin and operating system version. version at time was 1.13.4 and OS is Macbook Pro M1 Max

erwinc1 commented 1 year ago

nevermind, i blatantly copied the install-node-and-npm from the documentation where it specified node version 4.6. It seems npx is available from 5.2+. Suggestion to update documentation, then?