I’m having an issue when calling the function ‘createReadStream’ using the npm form-data package (https://www.npmjs.com/package/form-data).
Does anyone have experience to guide me in the right direction on this one? I included the small part of the code that is having the error:
import fs from 'form-data';
import FormData from 'form-data';
const form = new FormData();
filePaths.forEach((filePath) => {
form.append('files', fs.createReadStream(filePath));
});
Error: _formData.default.createReadStream is not a function
_formData.default.createReadStream is not a function