I already search solutions for this problem but all I can find is "missing semi colon" which is obviously not my problem... Here are the code and its error
Can anyone help me?
I already search solutions for this problem but all I can find is "missing semi colon" which is obviously not my problem
CodePudding user response:
Use fs.readdirSync
in line 41 instead.
CodePudding user response:
Based on the error log you provided, the files
Is not defined. Add a guard clause at line 47 to check field exist before running the code
if (files && files.length >0){
//original line 47-52
}