App.getPath("userData") seems to give the wrong path


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 =;


According to console, userData is


Shouldn’t it be this?



Found the answer on StackOverflow. Turns out my package.json should be more general, pointing to

"scripts": {
    "start": "electron ."

This resolved the issue for me.