I get this error in my application:
Error: EPERM: operation not allowed, open 'C: \ Program Files (x86) \ Full menu \ db \ main.json'
The application I use is built with an electronic template. I use this function to get the path to the root of the application:
path.dirname(process.execPath)
And this is the script that writes the file:
fs.writeFile(apath + '/db/' + elem + '.json', JSON.stringify(results)
I know what the problem is: permissions. But how can I get this to work without running the application as an administrator?
source
share