Estoy tratando de hacer lo siguiente en Node.JS:
var file= './elemento1.pdf';
var formData = {
'file': {
data: fs.createReadStream(file),
filename: 'elemento1',
contentType: 'application/pdf'
}
};
compareAndComply.classifyElements(formData, function(error, response){
if (error) {
console.log(error);
} else {
console.log(JSON.stringify(response, null, 2));
}
});
Pero me manda el siguiente error:
source.on is not a function
¿Como puedo arreglarlo? Muchas gracias