我正在尝试并且无法连接到Electron中的MySQL数据库。当我用npm start
运行程序时,在控制台中出现此错误:
有人告诉我要更改我的代码,但我没有做任何更改。我下载了名为bundled的模块,但是它也不起作用,我也不知道我是否正确使用了它。
[nodeIntegration
false
中可能BrowserWindow
被设置为webPreferences
(默认值)。
尝试使用以下方法设置浏览器窗口:
win = new BrowserWindow({ width: 800, height: 600,
webPreferences: {
nodeIntegration: true
}
})