1

I am using exec-maven-plugin to run my maven build to do a npm install, however, I am getting the following error and not sure why?


The error is:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (exec- 
npm-install) on project ccg: Command execution failed. Cannot run program 
"C:\Program Files\nodejs\npm" (in directory "C:\Users\blah\git\ccg- 
service\src\main\app"): CreateProcess error=193, %1 is not a valid Win32 
application

My pom.xml looks like the following:

<plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>exec-maven-plugin</artifactId>
     <executions>
         <execution>
             <id>exec-npm-install</id>
             <phase>generate-sources</phase>
             <configuration>                  
                  <workingDirectory>${project.basedir}src\main\app</workingDirectory>
                  <executable>npm</executable>
                  <arguments>
                       <argument>install</argument>
                  </arguments>
             </configuration>
             <goals>
                 <goal>exec</goal>
             </goals>
        </execution>
        <execution>
            <id>exec-npm-run-tsc</id>
            <phase>generate-sources</phase>
            <configuration>                              
                <workingDirectory>${project.basedir}src\main\app</workingDirectory>
                <executable>npm</executable>
                <arguments>
                    <argument>run</argument>
                    <argument>tsc</argument>
                </arguments>
            </configuration>
            <goals>
                <goal>exec</goal>
                </goals>
        </execution>
    </executions>
</plugin>
Robin
  • 575
  • 2
  • 10
  • 26

0 Answers0