Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:npm (npm install) on project aem-magazine.ui.frontend: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit

Avatar

Level 4

Hello, 

I am trying to create a AEM Maven archetype project named aem-magazine. When I run the build using IntelliJ it shows the below error. Can anyone help me with this ??

 

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.7.6:npm (npm install) on project aem-magazine.ui.frontend: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

 

I have also included my frontend pom.xml here

<?xml version="1.0" encoding="UTF-8"?>
<!--
| Copyright 2015 Adobe Systems Incorporated
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- ====================================================================== -->
<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<parent>
<groupId>com.adobe.aem.magazine</groupId>
<artifactId>aem-magazine</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<!-- ====================================================================== -->
<!-- P R O J E C T D E S C R I P T I O N -->
<!-- ====================================================================== -->
<artifactId>aem-magazine.ui.frontend</artifactId>
<packaging>pom</packaging>
<name>Magazine-Project - UI Frontend</name>


<!-- ====================================================================== -->
<!-- B U I L D D E F I N I T I O N -->
<!-- ====================================================================== -->
<build>
<sourceDirectory>src/main/content/jcr_root</sourceDirectory>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm run prod</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run prod</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>fedDev</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>npm run dev</id>
<phase>generate-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run dev</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@Tessa_learner1,

2 things to consider.

1. Building Locally

You must install the right version of node on your work machine. As a full stack engineer myself, I always need to jump back and fourth from different versions of node or NPM. Please consider the Node Version Manager for windows, as this installation will allow your work machine to seamlessly install/use node versions as require, on the same machine, GitHub - coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically writt...

You are probably getting this error maybe because you have not completed a "npm install". NPM install will download all the dependencies that your projects needs to build and compile. 

 

2. Maven Build Automation

For front-end automation using the com.github.eirslett plugin, it looks like you are missing the "npm install" step... 

This code should be ran before your npm run dev or npm run prod (this configuration might be already in the parent pom, but please take another look):

<plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <nodeVersion>v12.22.7</nodeVersion>
                        <npmVersion>6.14.0</npmVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>install node and npm</id>
                            <goals>
                                <goal>install-node-and-npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

Take a look at the latest AEM Maven archtype project to see how this plugin is structured: aem-project-archetype/pom.xml at develop · adobe/aem-project-archetype · GitHub

 

 

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @Tessa_learner1 ,

Try below thing 

     1. Please install latest node js update npm version in pom.

 

2.use below command.

Mvn clean install -padobe-public

 

 

Kr,

Sanjay

 

 

Avatar

Correct answer by
Community Advisor

@Tessa_learner1,

2 things to consider.

1. Building Locally

You must install the right version of node on your work machine. As a full stack engineer myself, I always need to jump back and fourth from different versions of node or NPM. Please consider the Node Version Manager for windows, as this installation will allow your work machine to seamlessly install/use node versions as require, on the same machine, GitHub - coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically writt...

You are probably getting this error maybe because you have not completed a "npm install". NPM install will download all the dependencies that your projects needs to build and compile. 

 

2. Maven Build Automation

For front-end automation using the com.github.eirslett plugin, it looks like you are missing the "npm install" step... 

This code should be ran before your npm run dev or npm run prod (this configuration might be already in the parent pom, but please take another look):

<plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend-maven-plugin.version}</version>
                    <configuration>
                        <nodeVersion>v12.22.7</nodeVersion>
                        <npmVersion>6.14.0</npmVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>install node and npm</id>
                            <goals>
                                <goal>install-node-and-npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

Take a look at the latest AEM Maven archtype project to see how this plugin is structured: aem-project-archetype/pom.xml at develop · adobe/aem-project-archetype · GitHub