Discord.js botu başlatırken "err_requıre_esm" hatası

pyrzsnz

Hectopat
Katılım
30 Mayıs 2021
Mesajlar
37
Daha fazla  
Cinsiyet
Erkek
Merhabalar. Discord botumu başlatırken aşağıdaki hatayı alıyorum.

JavaScript:
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: C:\Users\husey\Desktop\Pearl\node_modules\parse-ms\index.js
require() of ES modules is not supported.
require() of C:\Users\husey\Desktop\Pearl\node_modules\parse-ms\index.js from C:\Users\husey\Desktop\Pearl\komutlar\profil.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\Users\husey\Desktop\Pearl\node_modules\parse-ms\package.json.

 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1085:13)
 at Module.load (internal/modules/cjs/loader.js:933:32)
 at Function.Module._load (internal/modules/cjs/loader.js:774:14)
 at Module.require (internal/modules/cjs/loader.js:957:19)
 at require (internal/modules/cjs/helpers.js:88:18)
 at Object.<anonymous> (C:\Users\husey\Desktop\Pearl\komutlar\profil.js:3:13)
 at Module._compile (internal/modules/cjs/loader.js:1068:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
 at Module.load (internal/modules/cjs/loader.js:933:32)
 at Function.Module._load (internal/modules/cjs/loader.js:774:14) {
 code: 'ERR_REQUIRE_ESM'
 
Uyarı! Bu konu 5 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Technopat Haberler

Geri
Yukarı