AEM SPA project maven build failing - Failed to run task: npm test | Community
Skip to main content
Level 5
November 4, 2022
Solved

AEM SPA project maven build failing - Failed to run task: npm test

  • November 4, 2022
  • 2 replies
  • 1737 views

Hi All,

I am trying to create AEM SPA with React following this tutorial https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/spa-editor/react/create-project.html?lang=en. The project created using maven archetype 39, unable to build, fails during "npm run test" execution with message Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.12.0:npm (npm run test) on project aem-guides-wknd-spa.react.ui.frontend: Failed to run task: 'npm test. Also below is the type error

TypeError: Cannot read property 'match' of undefined
[INFO] at interpolate (C:\spa\aem-guides-wknd-spa.react\ui.frontend\node_modules\dotenv-expand\lib\main.js:8:28)
[INFO] at dotenvExpand (C:\spa\aem-guides-wknd-spa.react\ui.frontend\node_modules\dotenv-expand\lib\main.js:36:32)
[INFO] at dotenvFiles.forEach.dotenvFile (C:\spa\aem-guides-wknd-spa.react\ui.frontend\node_modules\react-scripts\config\env.js:43:29) 

Can anyone help me on how to resolve this issue?

I just updated node and npm versions in /ui.frontend/pom.xml as install node and npm execution was failing.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SrikanthPo3

Hi @iamnjain ,

Node version is 18.13.0 and NPM version is 8.19.3. I believe this issue has something to do with proxy as I faced this issue in office network behind a proxy but worked fine in my personal laptop.

We can ignore this issue as this occurred only behind a proxy.

Thanks for the support.

2 replies

kautuk_sahni
Community Manager
Community Manager
June 7, 2023

@iamnjain @somen-sarkar @suvrat @sunil_kumar_ 

Requesting your expertise on this AEM question. Appreciate your support in advance.

Kautuk Sahni
iamnjain
Community Advisor
Community Advisor
June 7, 2023

Hi @srikanthpo3 

 

can you please share your NPM and Node version?

Which you updated and old one, which came with project repo. 

 

And, Can you please provide more error logs if possible?

SrikanthPo3AuthorAccepted solution
Level 5
June 8, 2023

Hi @iamnjain ,

Node version is 18.13.0 and NPM version is 8.19.3. I believe this issue has something to do with proxy as I faced this issue in office network behind a proxy but worked fine in my personal laptop.

We can ignore this issue as this occurred only behind a proxy.

Thanks for the support.