title: Discord.js module error before first line of code
body: <p>I just started writing a Discord bot in Visual Studio Code in Javascript, it's literally the most basic it can be, loading discord.js, on ready event and then login.</p>
  <p>Before it even runs the first line of code, I get this error:</p>
  <pre class="lang-rb prettyprint-override"><code>Debugger listening on ws://127.0.0.1:5489/3cf4a3d1-ef26-4c1c-a274-030564d40731
  For help see https://nodejs.org/en/docs/inspector
  i:\Coding\Bots\PURGE\node_modules\discord.js\src\util\Util.js:584
        str = str.replace(/@([^&lt;&gt;@ ]*)/gmsu, (match, target) =&gt; {
                          ^
  
  SyntaxError: Invalid regular expression flags
      at createScript (vm.js:80:10)
      at Object.runInThisContext (vm.js:139:10)
      at Module._compile (module.js:607:28)
      at Object.Module._extensions..js (module.js:654:10)
      at Module.load (module.js:556:32)
      at tryModuleLoad (module.js:499:12)
      at Function.Module._load (module.js:491:3)
      at Module.require (module.js:587:17)
      at require (internal/module.js:11:18)
      at Object.&lt;anonymous&gt; (i:\Coding\Bots\PURGE\node_modules\discord.js\src\index.js:3:14)
  Process exited with code 1
  </code></pre>
  <p>The error occurs in the Discord.js module which I <strong>didn't write</strong>, and have no idea how it works and therefore cannot fix.</p>
  <p>Re-installling Discord.js didn't help, reinstalling Visual Studio Code didn't either.
  I sent a friend the exact same files (even the same node_modules folder) and when he runs it, it works with no problems. Any ideas what the problem is or how I can fix it?</p>
  <p>This is my code:</p>
  <pre class="lang-js prettyprint-override"><code>console.log(&quot;test&quot;) //DOESNT LOG
  
  const Discord = require(&quot;discord.js&quot;);
  const fs = require(&quot;fs&quot;);
  const config  = require(&quot;./config.json&quot;);
  let christian = {}
  
  //This will define our bot
  var bot = new Discord.Client()
  
  bot.on('message', async msg =&gt; {
      console.log(msg)
  })
  
  bot.on('ready', () =&gt; {
      console.log(`-----Purge#2420 Online-----\nWatching over ${bot.guilds.cache.size} servers |`)
  });
  
  bot.login(config.token)
  </code></pre>