[SOLVED] No such file or directory, scandir C:\<path>\commands\0

const commands_folder_path = path.join(__dirname, 'commands');
const command_folders = fs.readdirSync(commands_folder_path);

for (const sub_command_folder in command_folders) {
const sub_command_folder_path = path.join(commands_folder_path, sub_command_folder);
console.log(sub_command_folder_path) /** C:\<path>\commands\0 */

const sub_command_folder_files = fs.readdirSync(sub_command_folder_path).filter(file => file.endsWith('.js')); /** No such file or directory, scandir C:\<path>\commands\0 */
const commands_folder_path = path.join(__dirname, 'commands');
const command_folders = fs.readdirSync(commands_folder_path);

for (const sub_command_folder in command_folders) {
const sub_command_folder_path = path.join(commands_folder_path, sub_command_folder);
console.log(sub_command_folder_path) /** C:\<path>\commands\0 */

const sub_command_folder_files = fs.readdirSync(sub_command_folder_path).filter(file => file.endsWith('.js')); /** No such file or directory, scandir C:\<path>\commands\0 */
Anyone know why I'm getting this issue?
No description
12 Replies
d.js toolkit
d.js toolkit10mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
aw0k3n
aw0k3nOP10mo ago
discord.js list: "[email protected]" node version: "v20.11.1"
d.js docs
d.js docs10mo ago
:guide: Creating Your Bot: Command handling read more
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
aw0k3n
aw0k3nOP10mo ago
I did something wrong?
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
aw0k3n
aw0k3nOP10mo ago
My bad. I'll delete my message in #djs-help-v14.
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
aw0k3n
aw0k3nOP10mo ago
Oh my days. Yeah, I just fixed it. What's the difference between the two? in just uses like index, while the other uses something like values? index = 1 value = 'member'
d.js docs
d.js docs10mo ago
:mdn: for...in The for...in statement iterates over all enumerable string properties of an object (ignoring properties keyed by symbols), including inherited enumerable properties. :mdn: for...of The for...of statement executes a loop that operates on a sequence of values sourced from an iterable object. Iterable objects include instances of built-ins such as Array, String, TypedArray, Map, Set, NodeList (and other DOM collections), as well as the arguments object, generators produced by generator functions, and user-defined iterables.
aw0k3n
aw0k3nOP10mo ago
Ah, thank you for helping me.
Unknown User
Unknown User10mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server