1

Cyclic is a web hosting platform like Heroku

I am trying to create a file on cyclic in my NodeJS API. But, it turns out that the folder permission is write-only. How do I change folder permission to enable file writes in cyclic.sh

Here is the Error:

Error: EROFS: read-only file system, open 'public/ogData/https!www.stackoverflow.com.json'
    at Object.openSync (node:fs:600:3)
    at Object.writeFileSync (node:fs:2221:35)
    at saveOGInJson (file:///var/task/utils.mjs:12:6)
    at cacheOGInfo (file:///var/task/utils.mjs:88:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///var/task/index.mjs:18:16 {
  errno: -30,
  syscall: 'open',
  code: 'EROFS',
  path: 'public/ogData/https!www.stackoverflow.com.json'
}
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Artaza Sameen
  • 519
  • 1
  • 5
  • 13

1 Answers1

0

you can change premissions via Terminal. Use following command:

sudo chmod 777 ./YourFileName.sh
  • No there is not option to run terminal commands on cyclic. I also tried to run it on npm run start but it failed. – Artaza Sameen Feb 22 '23 at 15:56
  • i got this in documentation of cyclic: If you are hitting the EROFS error in processing files, one solution is to write to a file that is located in a /tmp directory. However, do not use /tmp for perminant storage, as is it wiped frequently. A more perminant solution to this error is to use the Cyclic S3fs drop-in replacement for Node.js fs, which gives you acces to an AWS S3 bucket to access as file storage in place of your local file system. https://docs.cyclic.sh/concepts/file_system – Daniel Batista Feb 22 '23 at 17:41