frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

Execute install-node-and-npm goal from command line

Open alexbde opened this issue 3 years ago • 2 comments
trafficstars

Hi! I have an edge case, where I just want to download node and npm. I tried to do via your plugin, because it contains the install-node-and-npm goal, which should do exactly what I need.

Sadly, executing from command line states:

$ mvn com.github.eirslett:frontend-maven-plugin:1.12.1:install-node-and-npm -DnodeVersion=v16.13.2
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1                                  
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE                                                           
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.192 s
[INFO] Finished at: 2022-01-27T17:20:36+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.1:install-node-and-npm (default-cli): Goal requires a project to execute but there is no POM in this directory. Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException

So, I asked myself: why does this goal need a pom.xml file? Is it missing any information? Or do I forgot to pass required parameters?

Thank you very much in advance!

alexbde avatar Jan 27 '22 16:01 alexbde

+1 The same use case. It would be nice if we can run the goal without pom.xml.

PetrivMykola avatar Mar 11 '23 22:03 PetrivMykola

Have you tried using a tool like nvm or volta instead? I believe that would be a better fit.

eirslett avatar Mar 12 '23 14:03 eirslett