mainWindow = new BrowserWindow({ webPreferences: { nodeIntegration: true } }) // nodeIntegration: true 加上这一句 就可以了 5.0以后默认是false
作者:艾孜尔江