The issue is that when you send a string to the writeFile method as fileName, it attempts to locate the file with the name you gave in the current directory but it contains the character "/" that is not allowed in file names and is therefore creating the error.
So the solution is to create the path by using the "path" library, See below code for example
const path = require('path');
// You may need to use relative path in join function depending upon the working file location
const filePath = path.join(__dirname, 'ouptputs/test.xlsx'); // __dirname -> returns the current path of the working file
const workSheet = XLSX.utils.json_to_sheet(data);
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, workSheet, 'Sheet1'); // Sheet1 is the name of sheet that is created inside workbook
const s = XLSX.writeFile(wb, filePath, {
bookType: 'xlsx',
type: 'file'
});
I hope this helps you.