When running the following in my packaged electron app:
fs.mkdirSync('myNewDirectory');
I keep getting EACCES: permission denied, mkdir
.
This doesn't happen when I'm in dev mode. It only happens after I package and run the app.
How do I get the appropriate permissions to create a directory, or even a file, in a packaged electron app?
mkdirSync
will attempt to create myNewDirectory relative to the current working directory. Try setting the absolute path, perhaps using __dirname
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With