1
votes

Using npm start, my app is able to create a folder (in my dev folder) using this:

fs.mkdir(`${__dirname}/logs/`, function(err) {
    if (err) console.log(err)
    console.log("Done")
});

After using npm run dist (running electron-builder), and then after running the installer, my app is installed to :

C:\Users\myUsername\AppData\Local\Programs\myApp

Now running the installed app, it is unable to create my folder logs in this new directory, why ? (nothing happen)

1
This must be caused due to permission issue. Try running the application as administrator or move logging to a folder outside some where. - Sajin

1 Answers

1
votes

Solved, you can't write in app folder, but you can here: app.getPath('userData')

Some other location are available, see more here