Error: [ERR_REQUIRE_ESM] require() of ES Module | NodeJS | Tamil

preview_player
Показать описание
Error Message:
const fetch = require("node-fetch")
^

Error [ERR_REQUIRE_ESM]: require() of ES Module *[file-path]* not supported.
Instead change the require of *[file-path]* to a dynamic import() which is available in all CommonJS modules.
at Object.[anonymous] (*[file-path]*) {
code: 'ERR_REQUIRE_ESM'

#nodejs

If you have any query mail Me:
Рекомендации по теме
Комментарии
Автор

Saved lot of time on research of this. Thank you.

jaganvittal
Автор

$ : The term '$' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1
+ ~
+ CategoryInfo : ObjectNotFound: ($:String) [], CommandNotFoun
dException
+ FullyQualifiedErrorId : CommandNotFoundException

ShinewithSwathi