简体   繁体   中英

Angular7 + maven with IBM websphere error (frontend-maven-plugin:1.0:npm (npm install fail))

I have a complete angular7 project and want to integrate with java. is there any way to do it?

I am using eclipse maven + ibm websphere. (not spring boot)

I referred this post(by @TimeTraveler) and tried to follow... however when I run command mvn clean package , I encounter this error

[INFO] --- frontend-maven-plugin:1.0:npm (npm install) @ angular7test ---
[INFO] Running 'npm install' in C:\Users\eclipse-workspace\angular7test\angular-project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:01 min
[INFO] Finished at: 2018-11-29T23:16:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project angular7test: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "C:\Users\eclipse-workspace\angular7test\node_installation\node\node.exe" (in directory "C:\Users\eclipse-workspace\angular7test\angular-project"): CreateProcess error=267, The directory name is invalid -> [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

and I also have a question .. based on that post , maven project looks like below

  • Maven Project -
  • src
    • main
    • java
    • resources
    • webapp
      • WEB-INF
      • web.xml
  • angular-project (I paste my angular project here)
  • node_installation ========>what is this?????
  • pom.xml

what is node_installation? .. is that a folder? do i need to create?

this is my package.. 在此处输入图片说明

The error you posted indicates that Maven can't find the node.js executable node.exe in order to build your Angular project. Make sure you configure your pom as indicated on the frontend-maven-plugin readme page so that it will install node and npm into your project dir where maven expects to find it. This will create the node_installation directory you are missing and populate it with the node.exe executable, which should resolve the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM