Path error electron with realm

Error: make_dir() failed: Read-only file system Path: /mongodb-realm/
I’m getting this error with electron app and realm

path.join(
      app.getPath('userData'),
      'public.realm'
    )

This is path I’m giving and it was working locally but this is not working on env.