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)


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");
}


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
Contribute to KiraKenjiro/Temp development by creating an account on GitHub.
Was this page helpful?