0

I am trying and failing to connect to a MySQL database in Electron. When I run the program with npm start, I get this error in the console:

electron

I was told to make changes to my code and I made them but nothing. I downloaded that module called bundlee but it didn't work either and I don't know if I used it correctly.

Dan
  • 59,490
  • 13
  • 101
  • 110

1 Answers1

1

It is likely that nodeIntegration is set to false (which is the default) in your BrowserWindow webPreferences.

Try setting up your browser window with something like this:

win = new BrowserWindow({ width: 800, height: 600, 
    webPreferences: {
      nodeIntegration: true
    } 
})
CUGreen
  • 3,066
  • 2
  • 13
  • 22