pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Electron do not work

Open Jey0707 opened this issue 3 years ago • 1 comments

What version of pkg are you using?

^5.8.0

What version of Node.js are you using?

v16.15.1

What operating system are you using?

Windows

What CPU architecture are you using?

arm64

What Node versions, OSs and CPU architectures are you building for?

node16

Describe the Bug

The exe as soon as I open it crash with this error:

ipcMain.on('openSite', (event, data) => {
        ^

TypeError: Cannot read properties of undefined (reading 'on')
    at Object.<anonymous> (C:\Users\Farella Vito\Desktop\AlphaScripts Cli 2.0\Windows Version\app.js:142:9)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

I think I need to change the start settings of pkg but I don't know how

Package.json:

{
  "name": "name",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "start": "electron .",
    "test": "electron .",
    "build": "pkg -t node16 app.js --config package.json",
    "buildn": "electron-packager . electron-app -all --no-prune"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.27.2",
    "discord-rpc": "^4.0.1",
    "discord.js": "^14.1.2",
    "electron": "^20.0.1",
    "electron-packager": "^15.5.1",
    "figlet": "^1.5.2",
    "hwid": "^0.2.1",
    "inquirer": "^8.0.0",
    "pkg": "^5.8.0",
    "socket.io": "^4.5.1"
  },
  "pkg": {
    "assets": [
      "node_modules/figlet/fonts/Slant.flf",
      "node_modules/electron/*"
    ]
  }
}

Expected Behavior

Should run with a GUI

To Reproduce

Just create an electron project and try to pkg all with node-16

Jey0707 avatar Aug 09 '22 22:08 Jey0707

try electron-builder

kingbotss avatar Aug 11 '22 10:08 kingbotss

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

github-actions[bot] avatar Nov 10 '22 00:11 github-actions[bot]

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

github-actions[bot] avatar Nov 16 '22 00:11 github-actions[bot]