bigcommerce / widget-builder

MIT License
18 stars 39 forks source link

widget-builder -h error #140

Closed nguyenphuochien97 closed 1 year ago

nguyenphuochien97 commented 1 year ago

I'm using:

After I run command npm run install-cli-win on Windows OS it works fine.

But when I run the command widget-builder -h I get error like below:

$ widget-builder -h
E:\widget-builder-1.0.0\dist\cli\run\init.js:10
const inquirer_1 = __importDefault(require("inquirer"));
                                   ^

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\widget-builder-1.0.0\node_modules\inquirer\lib\inquirer.js from E:\widget-builder-1.0.0\dist\cli\run\init.js not supported.
Instead change the require of inquirer.js in E:\widget-builder-1.0.0\dist\cli\run\init.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (E:\widget-builder-1.0.0\dist\cli\run\init.js:10:36)
    at Object.<anonymous> (E:\widget-builder-1.0.0\dist\cli\index.js:12:32) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v18.16.0
tehnorm commented 1 year ago

@nguyenphuochien97 seeing the same thing - did you find a fix for this? On Mac 22.3.0 Darwin Kernel Version 22.3.0:.

tehnorm commented 1 year ago

If I roll back to https://github.com/bigcommerce/widget-builder/tree/6de3e1f18eedc74a133febf68f8e812e302d3ab4 - then npm run install-cli the app builds as expected.

nguyenphuochien97 commented 1 year ago

@nguyenphuochien97 seeing the same thing - did you find a fix for this? On Mac 22.3.0 Darwin Kernel Version 22.3.0:.

Everything worked fine when I used the command npm install --save inquirer@^8.0.0