-4
  • Electron: 13.5.2
  • Webpack: 5.70.0
  • React: 18.1.0
console.log(__dirname);

I was expecting something like:

C:Users\...\Project\app\settings

But the output:

...\node_modules\electron\dist\resources\electron.asar\renderer

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 20 '22 at 20:28

1 Answers1

1

First of all __dirname shows the directory not the file so you shouldn't expect it to show a file.

Second __dirname shows directory name of the module that is currently run. Electron is starting the process, not your code.

Konrad
  • 21,590
  • 4
  • 28
  • 64