I have a simple app which is based off electron-quick-start with almost no changes. I'm trying to use nedb and pass it in my userData path.
My Package.json
"name": "my-electron-app",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"scripts": {
"start": "electron main.js"
}
My renderer script (app.js):
const remote = require('electron').remote;
const app = remote.app;
console.log(app.getPath('userData'))
According to console, userData is
C:\Users\me\AppData\Roaming\Electron
Shouldn't it be this?
C:\Users\me\AppData\Roaming\my-electron-app
I believe the issue is that you're pointing Electron to your script directly, meaning Electron is ignoring the existence of your package.json
file entirely. Thus it does not know the name of your app.
Try:
"scripts": {
"start": "electron ."
}
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