In the code I’ve succesfully deployed I’m creating a new folder like this:
const fs = require("fs");
createFolder = (folderName) => {
var dir = require("path").join(
require("os").homedir(),
`desktop/data/${filename}`
);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
};
It worked just fine when I run it in local, but now it gives e back this error:
Error: ENOENT: no such file or directory, mkdir '/opt/render/desktop/data/filename
[...]
Apr 24 07:37:41 PM syscall: 'mkdir',
Apr 24 07:37:41 PM code: 'ENOENT',
Apr 24 07:37:41 PM path: '/opt/render/desktop/data/filename
What should I do to fix it and be able to create a folder again?