Hi All,
I am facing some build issues in AEM CS. In local I dont see any error in build. but I am seeing these errors in CloudManager. Can someone help if there are any node upgrades required.
The error
18:21:59,081 [Exec Stream Pumper] [INFO]
18:21:59,081 [Exec Stream Pumper] [INFO] 2025-07-23 18:21:58: webpack 5.100.2 compiled with 64 warnings in 21252 ms
18:21:59,168 [Exec Stream Pumper] [INFO] node:internal/modules/cjs/loader:1002
18:21:59,168 [Exec Stream Pumper] [INFO] throw new ERR_REQUIRE_ESM(filename, true);
18:21:59,168 [Exec Stream Pumper] [INFO] ^
18:21:59,168 [Exec Stream Pumper] [INFO]
18:21:59,168 [Exec Stream Pumper] [INFO] Error [ERR_REQUIRE_ESM]: require() of ES Module /build_root/build/xxxxprogram-p28456/ui.frontend/node_modules/yargs/index.mjs not supported.
18:21:59,168 [Exec Stream Pumper] [INFO] Instead change the require of /build_root/build/xxxxxvprogram-p28456/ui.frontend/node_modules/yargs/index.mjs to a dynamic import() which is available in all CommonJS modules.
18:21:59,168 [Exec Stream Pumper] [INFO] at Object.<anonymous> (/build_root/build/xxxxxxprogram-p28456/ui.frontend/node_modules/aem-clientlib-generator/bin/clientlib-cli.js:8:13) {
18:21:59,168 [Exec Stream Pumper] [INFO] code: 'ERR_REQUIRE_ESM'
18:21:59,168 [Exec Stream Pumper] [INFO] }
Solved! Go to Solution.
Views
Replies
Total Likes
It's resolved for us by replacing
"aem-clientlib-generator": "^1.8.0"
with
"aem-clientlib-generator": "1.8.0"
Hi @cxasha ,
I think you're using require() for an ES Module (yargs), which isn't allowed in Node.js 18+ (used by AEM Cloud Manager). Fix it by replacing require() with import()[import yargs from 'yargs/yargs'] or switching to ESM syntax. Also update aem-clientlib-generator to its latest version to ensure compatibility.
Views
Replies
Total Likes
which files should i update? I have updated aem-clientlib-generator to latest version. I am still seeing the same issue
Views
Replies
Total Likes
Hi @cxasha,
Upgrade aem-clientlib-generator
Check your package.json in ui.frontend:
"devDependencies": {
"aem-clientlib-generator": "^1.8.0"
}
npm install aem-clientlib-generator@latest --save-dev
Recent versions of aem-clientlib-generator have switched to support ESM-compatible loading for yargs.
Downgrade yargs to a CommonJS version
If you cannot upgrade aem-clientlib-generator, manually force yargs to a version before 17.0.0, which still supported CommonJS:
npm install yargs@16.2.0 --save-dev
"resolutions": {
"yargs": "16.2.0"
}
Views
Replies
Total Likes
I have updated the yargs but still same issue with the build
Views
Replies
Total Likes
We are also facing the same issue. Kindly let us know here if you find the solution.
Views
Replies
Total Likes
It's resolved for us by replacing
"aem-clientlib-generator": "^1.8.0"
with
"aem-clientlib-generator": "1.8.0"
Views
Likes
Replies
Views
Likes
Replies