问答详情
源自:6-3 在 macOS 平台打包程序

electron.builder 在windows 平台上报错

⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed and version ("^7.1.7") is not fixed in project.


配置文件

"devDependencies": {

    "electron": "^7.1.7",

    "electron-builder": "^22.2.0",

    "electron-debug": "^2.0.0",

    "electron-devtools-installer": "^2.2.4",

    "nodemon": "^2.0.2"

  },

  "author": "qht",

  "license": "ISC",

  "scripts": {

    "start": "electron .",

    "dist": "electron-builder"

  },

  "build": {

    "productName": "qhtMusicPlayer",

    "appId": "qht.electron.music.player",

    "copyright": "cp2088",

    "directories": {

      "output": "build",

      "app": "./"

    },

    "nsis": {

      "oneClick": false,

      "allowElevation": true,

      "allowToChangeInstallationDirectory": true,

      "installerIcon": "ioc/f7.ico",

      "uninstallerIcon": "ioc/f7.ico",

      "installerHeaderIcon": "ioc/f7.ico",

      "createDesktopShortcut": true,

      "createStartMenuShortcut": true

    },

    "win": {

      "icon": "ioc/f7.ico",

      "target": [

        "nsis",

        "zip"

      ],

      "artifactName": "简单播放器"

    }

  }



提问者:qq_Q先生_0 2020-01-16 14:26

个回答

  • Subong
    2020-12-14 20:22:24

    大哥,有解决了吗,我也遇到了