Expand my Community achievements bar.

SOLVED

Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (npm run prod) on project portfolio-site.ui.frontend: Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2

Avatar

Level 4

While using command mvn clean install -PautoInstallPackage i am getting this error.

 

monish7_0-1705841333733.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

@monish_gavali 

Check this thread https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-deploy-ui-front... . This thread has most of the recommendations and check list.

Don't just focus on the  npm run prod error. You must have received one more error above and try fixing that. In my case i was having issue with src\main\webpack\components\atoms\xxxxxx-steps\xxxx-steps.scss and fixing that worked for me.

Here are some steps you could try:

1. Ensure that Node.js and npm are properly installed. You can check their versions by running node -v and npm -v in the terminal.

2. Check the JavaScript code in your project. The error log should provide more details about the specific file and line of code causing the issue. Sometimes, the problem can be as simple as a missing semicolon or an undefined variable.

3. Make sure that the Node.js and npm versions defined in the pom.xml file match the versions installed on your system.

4. Try running npm install and npm run prod directly from the terminal inside the portfolio-site.ui.frontend directory. This can sometimes provide more detailed error messages.

5. Check if there is a .npmrc file in the project and ensure that it doesn't contain any settings that might conflict with your environment.

6. Try deleting the node_modules folder and the package-lock.json file in the portfolio-site.ui.frontend directory, then run npm install again.

Remember, it's crucial to understand the error message returned by the npm command. The message Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2), indicates that the npm script prod is failing. Investigating the prod script in the package.json file or running the script directly in the terminal might provide more insight.

Additionally try focusing on the error you received just above this error in the log.



 

View solution in original post

2 Replies

Avatar

Community Advisor

Hi @monish_gavali 

Please check the below link

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/help-failed-to-execute-goa...

 

Also couple of things to check the archetype you are using 

the node version you have in you local . Both of these could cause this to fail. 

 

Thanks,

Sherin

 

 

Avatar

Correct answer by
Level 4

@monish_gavali 

Check this thread https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/failing-to-deploy-ui-front... . This thread has most of the recommendations and check list.

Don't just focus on the  npm run prod error. You must have received one more error above and try fixing that. In my case i was having issue with src\main\webpack\components\atoms\xxxxxx-steps\xxxx-steps.scss and fixing that worked for me.

Here are some steps you could try:

1. Ensure that Node.js and npm are properly installed. You can check their versions by running node -v and npm -v in the terminal.

2. Check the JavaScript code in your project. The error log should provide more details about the specific file and line of code causing the issue. Sometimes, the problem can be as simple as a missing semicolon or an undefined variable.

3. Make sure that the Node.js and npm versions defined in the pom.xml file match the versions installed on your system.

4. Try running npm install and npm run prod directly from the terminal inside the portfolio-site.ui.frontend directory. This can sometimes provide more detailed error messages.

5. Check if there is a .npmrc file in the project and ensure that it doesn't contain any settings that might conflict with your environment.

6. Try deleting the node_modules folder and the package-lock.json file in the portfolio-site.ui.frontend directory, then run npm install again.

Remember, it's crucial to understand the error message returned by the npm command. The message Failed to run task: 'npm run prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2), indicates that the npm script prod is failing. Investigating the prod script in the package.json file or running the script directly in the terminal might provide more insight.

Additionally try focusing on the error you received just above this error in the log.