I'm trying to manipulate files with NodeJS, using fs.copyFile
on my server (Debian Jessie), but I can not copy files. I've done everything to try to solve the problem, I've even copied exactly the example given in the documentation and replicated the files, but it's always the same error that is returned (including using fs.copyFileSync
).
The error displayed is TypeError: fs.copyFile is not a function
, and no additional information about it appears.
My code:
const fs = require('fs');
fs.copyFile('/home/savi/teste1.txt', '/home/savi/teste2.txt', (err) => {
if(!err){
console.log("Copiou");
}
});