I can't write on /tmp/file.txt (read-only file system)

Hi Guys, I’m trying to write on /tmp/file.txt I don’t know the reason why, it keeps giving me an EROFS: read-only file system Error

Hi @9orsaan

Why are you trying to write to /tmp? Is this during build, or in a function?

I’m trying to write through a function, This the code snippet:

router.post('/data',(req,res) =>{
    const content = req.body

    if(content != null){
        res.send("Data Updated!")

Context for others:


The problem is, you’re using ./tmp which is incorrect. The correct version is: /tmp.


@hrishikesh Thank You I’ll Try It

1 Like