electron-builder 打包后报错 找不到 electron.js
使用Electron 打包后报错 说找不到electron.js 都安装好几遍了 package.json 配置如下
{
"name": "my-electron",
"version": "0.1.0",
"author": "Ruoduan",
"private": true,
"main": "main.js",
"homepage": ".",
"dependencies": {
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1"
},
"build": {
"appId": "com.my-electron.app",
"mac": {
"target": [
"dmg",
"zip"
]
},
"win": {
"target": [
"nsis",
"zip"
]
}
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"electron-start": "electron .",
"dist": "electron-builder --win --x64"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"electron": "^6.0.9",
"electron-builder": "^21.2.0"
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你把
create-react-app
和electron
项目混淆了,你试一下把scripts
脚本里面的start
换成electron
的启动脚本你好,解决了吗