skip to Main Content

so ive been trying to fix this problem for the past hour and can get it to work, its probably a stupid mistake, but what you see here is my fs.readdir is defined.

vsc error + code

2

Answers


  1. You need to import fs. Put this above line 25 or your first use of fs

    const fs = require('fs');
    
    Login or Signup to reply.
  2. If you still don’t install the fs package, go to terminal then type npm install fs

    1. Click on Terminal
    2. On your keyboard command Ctrl + C if your bot is running
    3. type npm install fs or npm i fs
    4. On your code now type const fs = require('fs');

    You can put it on line 13 in your js file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search