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] }
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
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.
조회 수
답글
좋아요 수
which files should i update? I have updated aem-clientlib-generator to latest version. I am still seeing the same issue
조회 수
답글
좋아요 수
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"
}
조회 수
답글
좋아요 수
I have updated the yargs but still same issue with the build
조회 수
답글
좋아요 수
We are also facing the same issue. Kindly let us know here if you find the solution.
조회 수
답글
좋아요 수
It's resolved for us by replacing
"aem-clientlib-generator": "^1.8.0"
with
"aem-clientlib-generator": "1.8.0"
조회 수
Likes
답글