AEM Maven Project Build Failing in ui.frontend due to ERR_REQUIRE_ESM and Engine Warnings (Node Version Conflicts)
- August 3, 2025
- 2 replies
- 893 views
Hi Adobe Experts,
I’m trying to build an AEM project (using the latest SDK author-2024.11.18751) and the build keeps failing at the ui.frontend module.
Initially, I faced the error:
I followed previous suggestions to:
Downgrade vargs to 0.1.0
Delete node_modules and reinstall
Try with Node.js 16.x and 18.x
Modify my package.json accordingly
After these steps, the ERR_REQUIRE_ESM error persists intermittently, and now I also get warnings like:
Additionally, Maven reports:
Environment:
OS: Windows 11 Home Single Language (24H2)
AEM SDK: 2024.11.18751
Node.js Versions Tried: 16.17.0 and 18.20.4
npm: 8.15.0
Maven: 3.9.x
Frontend Build Tool: Webpack 5.x
What I’ve Tried:
Downgraded vargs to 0.1.0 in package.json
Cleaned node_modules, reinstalled with npm install
Switched Node.js versions (16 and 18) using NVM
Modified clientlib-cli.js to use dynamic import for vargs
Tried Maven commands:
mvn clean install
mvn clean install -PautoInstallPackage
Despite all this, the build still fails at the ui.frontend step.
Error Screenshot:
(Attach your latest screenshot showing the error log)
Questions for the Community:
✅ Which Node.js version is officially supported for AEM Project Archetype 2024.11?
✅ Is there a stable combination of vargs, aem-clientlib-generator, and Node.js that avoids this issue?
✅ How can I handle the ERR_REQUIRE_ESM in vargs when AEM’s frontend build expects CommonJS?
✅ Is there a way to bypass or fix the npm WARN EBADENGINE when using Node 16 or 18?
✅ Any official update or patch for ui.frontend to support ES Modules fully?
Request:
I am stuck and unable to proceed with creating the project. Any guidance, configuration fixes, or a working setup example would be greatly appreciated!
Thanks in advance,
Sai Sooraj