2

I'm new in NeutralinoJS, I'm trying my first app and I need to read the content of a json file. I'm trying by using Neutralino.filesystem.readFile method, but it fails with error

{
  code: "NE_RT_NATPRME",
  message: "Missing permission to execute the native method: filesystem.readFile"
}

I've tried also by reading the status of the file with filesystem.getStats but it fails with the same error. How can I activate the permissions to run filesystem.readFile and other filestystem method?

Raffaele
  • 737
  • 7
  • 21

1 Answers1

5

I was actually just coming across this same problem. Make sure in your neutralino.config.json you have filesystem.* in your nativeAllowList section like so:

  "nativeAllowList": [
    "app.*",
    "os.*",
    "filesystem.*",
    "debug.log"
  ],
spikehd
  • 234
  • 1
  • 6
  • 1
    Thanks for the solution and welcome in stackoverflow, it's strange it's not in in official documentation for `neutralino.filesystem` https://neutralino.js.org/docs/api/filesystem/ – Raffaele Apr 01 '22 at 07:43
  • I agree, the documentation is actually missing a lot lol, hopefully it continues to get updated because I have come across some problems with obvious solution in hindsight that are just nit mentioned. – spikehd Apr 01 '22 at 17:43
  • 1
    Not actually working... – Federico Massi Nov 15 '22 at 22:46