1// Example of code with error: EPERM: operation not permitted, open
2try {
3 // some code
4 return res.download(`storage/${fileName}.${format}`);
5} catch (e) {
6 return e;
7} finally {
8 unlinkSync(`storage/${fileName}.${format}`);
9}
10// Example of code without any error:
11try {
12 // some code
13 return res.download(`storage/${fileName}.${format}`, function (err) {
14 if (err) throw err;
15 unlinkSync(`storage/${fileName}.${format}`);
16 });
17} catch (e) {
18 return e;
19}
20
21// You can still try run the following commands in your terminal:
22 npm install -g npm@latest --force
23 npm update -g graceful-fs
24 npm cache clean --force
251Right click the C:/Users/YOUR_USERNAME/.ssh/config file, (The following applies to Windows:) go to Properties->Security->Advanced->Enable Inheritance.