title: NodeJS - TypeError: Cannot read property 'name' of undefined
body: <p>I am getting the following error from my code: If you could help me that would be amazing! I am using discord.js!</p>
  <hr />
  <blockquote>
  <p>TypeError: Cannot read property 'name' of undefined at
  files.forEach.file (/root/eternity-bot/eternity-bot/index.js:21:33) at
  Array.forEach () at fs.readdir
  (/root/eternity-bot/eternity-bot/index.js:18:9) at
  FSReqWrap.oncomplete (fs.js:135:15)</p>
  </blockquote>
  <hr />
  <pre><code>fs.readdir(&quot;./commands/&quot;, (err, files) =&gt; {
    if (err) return console.error(err);
    files.forEach(file =&gt; {
      if (!file.endsWith(&quot;.js&quot;)) return;
      let props = require(`./commands/${file}`);
      console.log(`Loading Command: ${props.help.name}.`);
      bot.commands.set(props.help.name, props);
      props.conf.aliases.forEach(alias =&gt; {
        bot.aliases.set(alias, props.help.name);
      })
    });
  });
  </code></pre>