Discord bot referenceerror: Fs is not defined hatası

memet01

Hectopat
Katılım
9 Nisan 2019
Mesajlar
45
Daha fazla  
Cinsiyet
Erkek
Node bot.js komutunu başlatıktan sonra bu hatayı alıyorum.

Kod:
C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:7
const fetch = require("node-fetch");
              ^

Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\node-fetch\src\index.js from C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js not supported.
Instead change the require of index.js in C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:7:15) {
  code: 'ERR_REQUIRE_ESM'
 
Son düzenleme:
Önce npm uninstall node-fetch yazıp sildikten sonra npm install node-fetch@2 yazıp deneyebilir misin?

O hata geçtide bu hata başladı reis

Kod:
C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\src\Manager.js:33
            throw new Error('Client is missing the "GUILD_MESSAGE_REACTIONS" intent.');
            ^

Error: Client is missing the "GUILD_MESSAGE_REACTIONS" intent.
    at new GiveawaysManager (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\src\Manager.js:33:19)
    at new GiveawayManagerWithOwnDatabase (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:717:40)
    at Object.<anonymous> (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:744:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
 
3. ve 4. satırı silip bunu koyup dene.
JavaScript:
const { Client, Util, Intents } = require("discord.js");
const client = new Client({ intents: ["Intents.FLAGS.GUILDS", "Intents.FLAGS.GUILD_MESSAGE_REACTIONS"]});
 
3. ve 4. satırı silip bunu koyup dene.
JavaScript:
const { Client, Util, Intents } = require("discord.js");
const client = new Client({ intents: ["Intents.FLAGS.GUILDS", "Intents.FLAGS.GUILD_MESSAGE_REACTIONS"]});
Kod:
C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\BitField.js:152
    throw new RangeError('BITFIELD_INVALID', bit);
    ^

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: Intents.FLAGS.GUILDS.
    at Function.resolve (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\BitField.js:152:11)
    at C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\BitField.js:147:54
    at Array.map (<anonymous>)
    at Function.resolve (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\BitField.js:147:40)
    at new BitField (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\BitField.js:17:38)
    at new Intents (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\node_modules\discord.js\src\util\Intents.js:8:1)
    at new GiveawaysManager (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\node_modules\discord-giveaways\src\Manager.js:32:14)
    at new GiveawayManagerWithOwnDatabase (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:717:40)
    at Object.<anonymous> (C:\Users\Mustafa\Desktop\pepper-viridian-maxilla-2021-11-19_120937\bot.js:744:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14) {
  [Symbol(code)]: 'BITFIELD_INVALID'
 
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.

Bu konuyu görüntüleyen kullanıcılar

Technopat Haberler

Geri
Yukarı