I'm trying to remove two files from my server with the following code:
const fs = require('fs');
const express = require('express');
const app = express();
app.delete('/delete', function(req, res){
fs.unlink('path/doc_1', function(){
fs.unlink('path/doc_2', function(){
res.end();
})
})
})
But the following error is thrown:
UnhandledPromiseRejectionWarning: Error: EBUSY: resource busy or locked, unlink
Has anyone ever been through this?