karlvr / openapi-generator-plus

A code generator for OpenAPI written in node and designed to have pluggable generators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Init command not working

Fredx87 opened this issue · comments

Running npm init openapi-generator-plus

Returns an error:

const inquirer_1 = __importDefault(require("inquirer"));
                                   ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/xxx/.npm/_npx/5e4467a700b9eb92/node_modules/inquirer/lib/inquirer.js from /Users/xxx/.npm/_npx/5e4467a700b9eb92/node_modules/create-openapi-generator-plus/dist/create-api-project.js not supported.
Instead change the require of inquirer.js in /Users/xxx/.npm/_npx/5e4467a700b9eb92/node_modules/create-openapi-generator-plus/dist/create-api-project.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/Users/xxx/.npm/_npx/5e4467a700b9eb92/node_modules/create-openapi-generator-plus/dist/create-api-project.js:34:36) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.11.0

@Fredx87 thank you, I see I broke it with the upgrade of dependencies... it's a tricky time at the moment with ESM. I'll fix it now.

@Fredx87 that appears to be fixed in the latest release (1.1.3). Thanks for letting me know.