请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

打包时出现default Electron icon is used reason=application icon is not set出错

老师你好,打包时候出错以下报错:

> electron-builder --dir

  • electron-builder  version=22.13.1 os=10.0.19042
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist\builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=node-sass@6.0.1 platform=win32 arch=x64
  • packaging       platform=win32 arch=x64 electron=13.1.8 appOutDir=dist\win-unpacked
  • default Electron icon is used  reason=application icon is not set
  ⨯ cannot execute  cause=exit status 1
                    errorOut=Fatal error: Unable to commit changes

                    command='C:\Users\Administrator\AppData\Local\electron-builder\Cache\winCodeSign\winCodeSign-2.6.0\rcedit-x64.exe' 'D:\prj\source\react\my-project\dist\win-unpacked\七牛云文档.exe' --set-version-string FileDescription '七牛云文档' --set-version-string ProductName '七牛云文档' --set-version-string LegalCopyright 'Copyright © year eric ye' --set-file-version 0.1.0 --set-product-version 0.1.0.0 --set-version-string InternalName '七牛云文档' --set-version-string OriginalFilename '' --set-version-string CompanyName 'eric ye'
                    workingDir=
  • Above command failed, retrying 3 more times

package.json.json文件如下:

{
  "name": "my-project",
  "version": "0.1.0",
  "private": true,
  "main": "main.js",
  "description": "Online Markdown Editor using Qiniu cloud service",
  "author": {
    "name": "eric ye",
    "email": "eric.ye@anker.com"
  },
  "repository": "https://git.imooc.com/coding-384/cloud-doc",
  "dependencies": {
    "@fortawesome/fontawesome-free": "^5.15.4",
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/react-fontawesome": "^0.1.15",
    "@testing-library/jest-dom": "^5.14.1",
    "@testing-library/react": "^11.2.7",
    "@testing-library/user-event": "^12.8.3",
    "axios": "^0.23.0",
    "bootstrap": "^5.1.0",
    "classnames": "^2.3.1",
    "easymde": "^2.15.0",
    "electron-is-dev": "^2.0.0",
    "electron-store": "^8.0.0",
    "node-sass": "^6.0.1",
    "qiniu": "^7.4.0",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-scripts": "4.0.3",
    "react-simplemde-editor": "^5.0.1",
    "uuid": "^8.3.2",
    "web-vitals": "^1.1.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "dev": "concurrently \" cross-env BROWSER=none npm start\" \"wait-on http://localhost:3000/ && electron .\" ",
    "pack": "electron-builder --dir",
    "dist": "electron-builder"
  },
  "homepage": "./",
  "build": {
    "appId": "cloud-doc",
    "productName": "七牛云文档",
    "copyright": "Copyright © year ${author}",
    "extends": null
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "concurrently": "^6.2.1",
    "cross-env": "^7.0.3",
    "electron": "^13.1.8",
    "electron-builder": "^22.13.1",
    "wait-on": "^6.0.0"
  }
}

正在回答 回答被采纳积分+3

1回答

张轩 2021-10-14 09:32:38

同学你好 在 github 的 issue 中找到很多和你相同的问题,最后很多人发现时杀毒软件问题,https://github.com/electron/electron-packager/issues/590#issuecomment-559638237

rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes
禁用掉防病毒软件windows防火墙再打包就ok了!

可以试一试~

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信