npm start报错
来源:2-2 Eelectron介绍(初始化项目+配置加速源)
unbreakable_全栈
2022-08-19 07:53:18
问题描述:
npm start报错
相关代码:
尝试过的解决方式:
切换node 版本 ;版本都不行 12.9.0 14.7.0 18.6.0 不行;
尝试重新安装依赖。不行;
安装跟老师一样的依赖 cnpm i -D electron@15.3.0 不行;
检查代码,没看出代码有啥问题;
百度没找出啥来
2回答
unbreakable_全栈
提问者
2022-08-19
BrowserWindow
这里写错啦
// Common.js规范
const { app, BrowserWindow } = require('electron')
// 主进程
const createWindow = () => {
const win = new BrowserWindow({
width:800,
height: 600
});
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
unbreakable_全栈
提问者
2022-08-19
// Common.js规范
const { app, BrowserView } = require('electron')
// 主进程
const createWindow = () => {
const win = new BrowserView({
width:800,
height: 600
})
win.loadFile('index.html')
}
app.whenReady().then(createWindow)
相似问题