title: ERROR_REQUIRE_ESM in discord.js
body: <p>I have a code which I'm doing on replit, and I'm pretty new to node.js so I really do need assistance with this. I have a code which is this:</p>
  <pre class="lang-py prettyprint-override"><code>const Discord = require(&quot;discord.js&quot;)
  const fetch = require(&quot;node-fetch&quot;)
  const client = new Discord.Client()
  const mySecret = process.env['TOKEN']
  
  function getQuote() {
      return fetch('https://zenquotes.io/api/random')
       .then(res =&gt; {
           return res.json
       })
       .then(data =&gt; {
           return data[0][&quot;q&quot;] + &quot; —&quot; +  data [0][&quot;a&quot;]
       })
  
  
  
  }
  
  client.on(&quot;ready&quot;, () =&gt; {
      console.log('Logged in as ${client.user.tag}' )
  })
  
  client.on(&quot;message&quot;, msg =&gt; {
      if (msg.author.bot) return
  
  
  
      if (msg.content === &quot;$inspire&quot;) {
          getQuote().then(quote =&gt; msg.channel.send(quote))
  
      }
  })
  
  
  client.login(process.env.TOKEN)
  </code></pre>
  <p>However, I'm receiving the error:</p>
  <pre class="lang-py prettyprint-override"><code>npx node .
  /home/runner/1Starty/index.js:2
  const fetch = require(&quot;node-fetch&quot;)
                ^
  
  Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/1Starty/node_modules/node-fetch/src/index.js from /home/runner/1Starty/index.js not supported.
  Instead change the require of /home/runner/1Starty/node_modules/node-fetch/src/index.js in /home/runner/1Starty/index.js to a dynamic import() which is available in all CommonJS modules.
      at Object.&lt;anonymous&gt; (/home/runner/1Starty/index.js:2:15) {
    code: 'ERR_REQUIRE_ESM'
  }
  </code></pre>
  <p>May someone help me on why this is the case?</p>