spring-attic / tut-react-and-spring-data-rest

React.js and Spring Data REST :: A tutorial based on the 5-part blog series by Greg Turnquist
https://spring.io/guides/tutorials/react-and-spring-data-rest
883 stars 1.58k forks source link

Executing goal indstall-node-and-npm error #128

Open SigurdMoth opened 4 years ago

SigurdMoth commented 4 years ago

I tried to do this tutorial with a friend but we got stuck due to something either being too implicit or wrong (outdated?).

We more specifically couldn't find a way to complete "Loading JavaScript Module". If we follow the steps exactly as they are stated, we receive errors about executing its goal install-node-and-npm, npm and webpack from the eirslett plugin / repository.

pablozoani commented 3 years ago

I am having the same issue.

Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:install-node-and-npm (default-cli) on project spring-react: The parameters 'nodeVersion' for goal com.github.eirslett:frontend-maven-plugin:1.9.1:install-node-and-npm are missing or invalid

The point is that the nice tutorial doesn't work. :'(

terylla commented 3 years ago

@pablozoani @SigurdMoth Hey guys! Not sure if you guys are still working on this. I think it has to do with how you did the plugin!

Apparently, you're supposed to do it like this:

<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.9.1</version>
                <configuration>
                    <installDirectory>target</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>

                        <configuration>
                            <nodeVersion>v15.2.1</nodeVersion>
                            <!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution -->
                            <npmVersion>6.14.9</npmVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>webpack build</id>
                        <goals>
                            <goal>webpack</goal>
                        </goals>
                    </execution>
                </executions>
  </plugin>

...I know. It took me hours to figure it out because it wasn't in the tutorials. Good luck!!