Skip to Content
0
Jan 06, 2023 at 12:16 PM

Command run failed with error require() of ES Module is not supported.

122 Views

Hi Experts,

I want to develop and preview fiori application. I have VS code and npm packages installed .

├── @sap/generator-fiori@1.8.4

├── @sap/ux-specification@1.102.11

├── @sap/ux-ui5-tooling@1.8.0

├── @sap-ux/ui5-middleware-fe-mockserver@2.1.41

└── @ui5/cli@2.14.16

However, when I try to preview application I get following error :

Command run failed with error require() of ES Module C:\...\project1\node_modules\xdg-basedir\index.js from C:\...\project1\node_modules\@sap\ux-ui5-tooling\dist\cli\index.js not supported.

Instead change the require of C:\...\project1\node_modules\xdg-basedir\index.js in C:\...\project1\node_modules\@sap\ux-ui5-tooling\dist\cli\index.js to a dynamic import() which is available in all CommonJS modules.

How do I resolve this issue ?