Nextjs Application not creating folder in ./temp in development
Unanswered
Pyrrhuloxia posted this in #help-forum
PyrrhuloxiaOP
Below is the code and error I am getting.
Code:
Error:
Edit: It works fine in local but not on vercel
Code:
const tmpDir = "C:\Windows\Temp\Data";
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, { recursive: true });
}Error:
Error: ENOENT: no such file or directory, mkdir 'C:/Windows/Temp/Data'
at Object.mkdirSync (node:fs:1391:3)
at POST (/var/task/.next/server/app/api/gdrive/latexcodegen/route.js:85:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /var/task/.next/server/chunks/5981.js:5134:37 {
errno: -2,
syscall: 'mkdir',
code: 'ENOENT',
path: 'C:/Windows/Temp/Data'
}Edit: It works fine in local but not on vercel