I am getting an error and I have tried everything but nothing works.
TypeError: Cannot read properties of undefined (reading 'name')
at Object.<anonymous> (/home/runner/NauticalAgonizingRegisters/index.js:12:35)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Code at index.js:12:35
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.data.name, command);
}
command.dataisundefined. Have a look at the files in thecommandsfolder — are they all exporting adataobject?dataobject. The other two are not application commands.