Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERR_REQUIRE_ESM error on latest-version #10848

Open
patrickdk77 opened this issue Mar 9, 2025 · 0 comments
Open

ERR_REQUIRE_ESM error on latest-version #10848

patrickdk77 opened this issue Mar 9, 2025 · 0 comments
Labels

Comments

@patrickdk77
Copy link

Describe the bug

running lb4 cli causes errors, v6.2.2

Logs

/projects/be/node_modules/@loopback/cli/lib/version-helper.js:11
const latestVersion = require('latest-version');
                      ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /projects/be/node_modules/latest-version/index.js from /projects/be/node_modules/@loopback/cli/lib/version-helper.js not supported.
Instead change the require of index.js in /projects/be/node_modules/@loopback/cli/lib/version-helper.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/projects/be/node_modules/@loopback/cli/lib/version-helper.js:11:23)
    at Object.<anonymous> (/projects/be/node_modules/@loopback/cli/lib/cli.js:14:25) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v20.18.3

Additional information

No response

Reproduction

npm install @loopback/cli; ./node_modules/.bin/lb4

@patrickdk77 patrickdk77 added the bug label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant