main.js: 添加nodeIntegration参数
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
nodeIntegration:true //process和require
}
})
main.js: 添加nodeIntegration参数
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
}
})
本文标题:外部js添加node的porcess和require报错unde
本文链接:https://www.haomeiwen.com/subject/lqqhphtx.html
网友评论