title: TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
body: <p>I followed CodeLyon's tutorial on YouTube to make a discord music bot because I have no idea what I'm doing, and I don't know what I've done wrong or what to do. The bot joins the voice channel I'm in, but it doesn't play anything, and this comes up in the terminal:</p>
  
  <pre><code>var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&amp;&amp;typeof process.versions==="object"&amp;&amp;typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&amp;&amp;!ENVIRONMENT_IS_WEB&amp;&amp;!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&amp;&amp;!ENVIRONMENT_IS_NODE&amp;&amp;!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Mod   
  abort(TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object). Build with -s ASSERTIONS=1 for more info.
  </code></pre>
  
  <pre><code>const Discord = require('discord.js');
  const bot = new Discord.Client();
  
  const ytdl = require("ytdl-core");
  
  const token = '';
  
  const PREFIX = '!';
  
  var servers = {};
  
  bot.on('ready', () =&gt;{
      console.log('This bot is online!')
  })
  
  bot.on('message', message=&gt;{
  
      let args = message.content.substring(PREFIX.length).split(" ");
  
      switch(args[0]){
          case 'play':
  
              function play(connection, message){
                   var server = servers[message.guild.id];
  
                   server.dispatcher = connection.playStream(ytdl(server.queue[0], {filter: "audioonly"}));
  
                   server.queue.shift();
  
                   server.dispatcher.on("end", function(){
                       if(server.queue[0]){
                          play(connection, message);
                      }else {
                          connection.disconnect();
                      }
                  });
              }
  
  
               if(!args[1]){
                   message.channel.send("You need to enter a link.");
                   return;
               }
  
               if(!message.member.voiceChannel){
                   message.channel.send("You have to be in a voice channel.");
                   return;
               }
  
               if(!servers[message.guild.id]) servers[message.guild.id] = {
                   queue: []
               }
  
               var server = servers[message.guild.id];
  
               server.queue.push(args[1]);
  
               if(!message.guild.voiceConnection) message.member.voiceChannel.join().then(function(connection){
                   play(connection, message);
               })
               break;
  
      }
  
  
  });
  
  bot.login(token);
  </code></pre>
  
  <p>(I've removed the value for token)</p>