Expand my Community achievements bar.

Maven error when I run mvn clean install -PautoInstallPackage command for AEM React project

Avatar

Level 2

When I try to run >mvn clean install -PautoInstallPackage after creating an AEM project with React JS I am getting the bellow error. Please help me on this. I have used maven-plugin:1.4.0 aswell but the result is same.

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (n
pm install) on project cargill-dsc.ui.apps: Command execution failed.: Cannot ru
n program "npm" (in directory "D:\Cargill\DSC\cargill-dsc\ui.apps\src\main\ts"):
CreateProcess error=2, The system cannot find the file specified -> [Help 1]

And my ui-apps pom is looks like for the section of npm.

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.4.0</version>
  <executions>
  <execution>
  <id>npm install</id>
  <phase>generate-resources</phase>
  <goals>
  <goal>exec</goal>
  </goals>
  <configuration>
  <skip>${skip-npm-install}</skip>
  <workingDirectory>${basedir}/src/main/ts</workingDirectory>
  <executable>npm</executable>
  <arguments>
  <argument>install</argument>
  </arguments>
  </configuration>
  </execution>
  <execution>
  <id>npm start</id>
  <phase>generate-resources</phase>
  <goals>
  <goal>exec</goal>
  </goals>
  <!-- TODO we need to define environment mode: product|development -->
  <configuration>
  <skip>${skip-npm-start}</skip>
  <workingDirectory>${basedir}/src/main/ts</workingDirectory>
  <executable>npm</executable>
  <arguments>
  <argument>run</argument>
  <argument>start</argument>
  <argument>--env=${javascript.environment}</argument>
  </arguments>
  </configuration>
  </execution>
  </executions>
  </plugin>

2 Replies

Avatar

Level 10

When you remove that JS framework - does it work?

Avatar

Level 10

Also using React is not the preferred language to build AEM front end components - that would be HTL.