TypeError: fs.existsSync is not a function

Could anyone help me with this, I'm a little confused about why it's not working but.
Error while executing 'agree': TypeError: fs.existsSync is not a function
at Object.execute (/Users/kirakenjiro/Desktop/Coding/DiscordBotBoilerPlate/buttons/viewCaptcha.js:18:21)
at async Client.<anonymous> (/Users/kirakenjiro/Desktop/Coding/DiscordBotBoilerPlate/index.js:121:5)
Error while executing 'agree': TypeError: fs.existsSync is not a function
at Object.execute (/Users/kirakenjiro/Desktop/Coding/DiscordBotBoilerPlate/buttons/viewCaptcha.js:18:21)
at async Client.<anonymous> (/Users/kirakenjiro/Desktop/Coding/DiscordBotBoilerPlate/index.js:121:5)
There is the full error, In vieCaptcha.js is this line
// Ensure the JSON file exists
if (!fs.existsSync(jsonFilePath)) {
fs.writeFileSync(jsonFilePath, JSON.stringify({}), "utf-8");
}
// Ensure the JSON file exists
if (!fs.existsSync(jsonFilePath)) {
fs.writeFileSync(jsonFilePath, JSON.stringify({}), "utf-8");
}
Here’s the Git of the full repo. But i just can't figure out why it's not working. https://github.com/KiraKenjiro/Temp
GitHub
GitHub - KiraKenjiro/Temp
Contribute to KiraKenjiro/Temp development by creating an account on GitHub.
2 Replies
d.js toolkit
d.js toolkit13mo 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 OP
treble/luna
treble/luna13mo ago
Not djs relatedw #other-js-ts
Want results from more Discord servers?
Add your server