index.js
const fs = require('fs');
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
filesystem:
src
-commands
-stuff.js
-config.json
-index.js
Error:
Error: ENOENT: no such file or directory, scandir './commands/'
at Object.readdirSync (fs.js:783:3)
The folder is there, and has files in it. I tried './commands/' , './commands' , 'commands' , nothing seems to work.