变量头像是文件路径,不用管它。
function rm (){
fs.rm(avatar)
}
writeStream.on("finish", rm())
但它显示了这个错误:
TypeError: callback is not a function
at CB (internal/fs/rimraf.js:59:5)
at internal/fs/rimraf.js:90:14
at FSReqCallback.oncomplete (fs.js:171:23)