j'ai essayé de remplacer les données images avec le système de fichiers, mais je ne pouvais pas trouver ce qui est le mistake.how puis-je résoudre ceévénement Unhandled « erreur » avec fs dans le nœud js
Voici le code
fs.readFile(background, function (err, data) {
fs.writeFile(backgroundImage, backgroundimageBuffer.data, function (err) {
im.resize({
srcPath:backgroundImage,
dstPath: background,
width: backgroundDimensions.width,
height: backgroundDimensions.height
}, function(err, stdout, stderr){
if(err) throw err;
console.log('resized image to fit within ' + backgroundDimensions.width + ' and ' + backgroundDimensions.height);
});
console.log("success");
});
});
erreur
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn convert ENOENT
at exports._errnoException (util.js:874:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
Est-ce que fond de fichier existe? – prasun
oui, il existe déjà – Thusithz