function createAddItemWindow() {
// Create a new window
addItemWindown = new BrowserWindow({
width: 300,
height: 200,
title: 'Add Item',
// The lines below solved the issue
webPreferences: { //根据上方的代码查找 然后加上这段代码
nodeIntegration: true,
contextIsolation: false
}
})}