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.24k stars 871 forks source link

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

Open alexbde opened 2 years ago

alexbde commented 2 years ago

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!

PetrivMykola commented 1 year ago

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

eirslett commented 1 year ago

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