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

Error [ERR_REQUIRE_ESM] at require("nanoid") in conf.js #4

Open
SureshKarthik opened this issue Mar 17, 2023 · 1 comment
Open

Error [ERR_REQUIRE_ESM] at require("nanoid") in conf.js #4

SureshKarthik opened this issue Mar 17, 2023 · 1 comment

Comments

@SureshKarthik
Copy link

var nanoid = require("nanoid");

node thyme.js
nCube-Thyme-Nodejs\conf.js:16
var nanoid = require("nanoid");
^

Error [ERR_REQUIRE_ESM]: require() of ES Module nCube-Thyme-Nodejs\node_modules\nanoid\index.js from nCube-Thyme-Nodejs\conf.js not supported.
Instead change the require of index.js in nCube-Thyme-Nodejs\conf.js to a dynamic import() which is available in all CommonJS modules.
at Object. (nCube-Thyme-Nodejs\conf.js:16:14)
at Object. (nCube-Thyme-Nodejs\thyme.js:20:15) {
code: 'ERR_REQUIRE_ESM'
}

Node.js v18.12.1

@SureshKarthik
Copy link
Author

Same issue is observed in latest stable Node.js v18.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant