Skip to content Skip to sidebar Skip to footer

Error When Using Electron `app.getPath('home');`

I have the following code within a script I am using within my electron app: window.$ = window.jQuery = require('jquery'); const { app } = require('electron'); $(document).ready

Solution 1:

window.$ = window.jQuery = require('jquery');
const { remote } = require('electron');
const app = remote.app;

$(document).ready(function() {
   let home = app.getPath('home');
   console.log(home)
   let homePathTemplate = document.getElementById('home');
   homePathTemplate.innerHTML(home);
});

And make sure you are enabling nodeIntegration when you are creating BrowserWindow in main process


Post a Comment for "Error When Using Electron `app.getPath('home');`"