Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing to Package Application for arch: x64 #434

Closed
mmick66 opened this issue Feb 19, 2018 · 30 comments
Closed

Preparing to Package Application for arch: x64 #434

mmick66 opened this issue Feb 19, 2018 · 30 comments

Comments

@mmick66
Copy link

mmick66 commented Feb 19, 2018

I am initialising a vanilla electron-forge project and run

electron-forge init test
cd test
electron-forge package

I get stuck on

✔ Checking your system
⠦ Preparing to Package Application for arch: x64

for ever...

OS: Mac OS: 10.12.6
Forge Version: 5.1.0

My config looks like this...

"forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip",
          "dmg"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn",
        "icon": "src/assets/icons/manicon.icns",
        "ignore": [".idea", "coverage"]
      },
      "electronWinstallerConfig": {
        "name": "rafconvert"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "rafconvert"
      }
    }
@malept
Copy link
Member

malept commented Feb 20, 2018

Thanks for filing an issue! In order to help you with your problem, we're going to need more information about it. In particular:

  • Console output when you run DEBUG=electron-packager electron-forge package.

@mmick66
Copy link
Author

mmick66 commented Feb 20, 2018

Thanks for the reply, it gets stuck again after printing this:

✔ Checking your system
⠋ Preparing to Package Application for arch: x64  electron-packager Electron Packager 10.1.2 +0ms
  electron-packager Node v9.2.1 +1ms
  electron-packager Host Operating system: darwin (x64) +0ms
  electron-packager Packager Options: {"asar":false,"overwrite":true,"packageManager":"yarn","icon":"src/assets/icons/manicon.icns","ignore":[".idea","coverage"],"afterCopy":[null],"afterExtract":[null],"afterPrune":[null],"dir":"/Users/mmichailidis/Programs/forge/rafconvert","arch":"x64","platform":"darwin","out":"/Users/mmichailidis/Programs/forge/rafconvert/out","electronVersion":"1.8.2","quiet":true} +0ms
  electron-packager Target Platforms: darwin +0ms
  electron-packager Target Architectures: x64 +0ms
  electron-packager Inferring application name from productName in /Users/mmichailidis/Programs/forge/rafconvert/package.json +0ms
  electron-packager Inferring appVersion from version in /Users/mmichailidis/Programs/forge/rafconvert/package.json +0ms
  electron-packager Application name: rafconvert +5ms
  electron-packager Target Electron version: 1.8.2 +0ms
  electron-packager Ignored path regular expressions: [ '.idea',
  'coverage',
  '/node_modules/electron($|/)',
  '/node_modules/electron-prebuilt(-compile)?($|/)',
  '/node_modules/electron-packager($|/)',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$' ] +0ms
⠹ Preparing to Package Application for arch: x64  electron-packager Downloading Electron with options {"platform":"darwin","arch":"x64","version":"1.8.2"} +0ms
⠴ Preparing to Package Application for arch: x64  electron-packager Creating /var/folders/hq/0n_8772d5xlbr58_jyzqvv7m0000gp/T/electron-packager/darwin-x64-template +3s
  electron-packager Extracting /Users/mmichailidis/.electron/electron-v1.8.2-darwin-x64.zip to /var/folders/hq/0n_8772d5xlbr58_jyzqvv7m0000gp/T/electron-packager/darwin-x64-template +1ms
⠼ Preparing to Package Application for arch: x64  electron-packager Initializing app in /var/folders/hq/0n_8772d5xlbr58_jyzqvv7m0000gp/T/electron-packager/darwin-x64/rafconvert-darwin-x64 from /var/folders/hq/0n_8772d5xlbr58_jyzqvv7m0000gp/T/electron-packager/darwin-x64-template template +0ms
⠴ Preparing to Package Application for arch: x64  electron-packager Ignored paths based on the out param: [ '/Users/mmichailidis/Programs/forge/rafconvert/out' ] +4s
⠇ Preparing to Package Application for arch: x64

Checked on a second system (MacOS same version) and it failed in the same way...

@mmick66 mmick66 closed this as completed Feb 20, 2018
@jacky-ttt
Copy link

@mmick66 I am having the same problem. It sticks at "Preparing to Package Application for arch: x64" and having the same debug log as you. Did you solved the problem?

@mkndn
Copy link

mkndn commented Apr 13, 2018

Did you resolve it?
If so, can you please share the steps. I have tried all the steps but nothing is working out. I'm stuck

@mmick66

This comment has been minimized.

@malept
Copy link
Member

malept commented Apr 13, 2018

It's difficult to debug this because there's not enough information to get an idea of what's happening. It seems like it's stalling in copying the app.

  • Does this only happen on macOS hosts?
  • What happens if you try to build a Linux target (electron-forge package --platform linux) ?
  • What happens if you try to build a darwin target on another host platform (like Linux or Windows)?

@mkndn
Copy link

mkndn commented Apr 13, 2018

I'm facing the same issue. Please refer the post here for the details

Does this only happen on macOS hosts? I can't test this as i am working only on windows.
What happens if you try to build a Linux target (electron-forge package --platform linux) ? Received the same issue
What happens if you try to build a darwin target on another host platform (like Linux or Windows)? I got the error below,

- Preparing to Package Application for arch: x64  electron-packager Downloading Electron with options {"platform":"darwin","arch":"x64","version":"1.8.4"} +0ms
Downloading tmp-7988-0-electron-v1.8.4-darwin-x64.zip
[============================================>] 100.0% of 48.34 MB (844.38 kB/s)
- Preparing to Package Application for arch: x64
An unhandled rejection has occurred inside Forge:
Cannot read property 'succeed' of undefined
TypeError: Cannot read property 'succeed' of undefined
    at C:\projects\script-generator\node_modules\electron-forge\dist\api\package.js:315:21
    at Generator.next (<anonymous>)
    at Generator.tryCatcher (C:\projects\script-generator\node_modules\bluebird\js\release\util.js:16:23)
    at PromiseSpawn._promiseFulfilled (C:\projects\script-generator\node_modules\bluebird\js\release\generators.js:97:49)
    at Async._drainQueue (C:\projects\script-generator\node_modules\bluebird\js\release\async.js:138:12)
    at Async._drainQueues (C:\projects\script-generator\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\projects\script-generator\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] package: `electron-forge package --platform=darwin`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] package script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\...\AppData\Roaming\npm-cache\_logs\2018-04-13T16_58_18_089Z-debug.log

@malept
Copy link
Member

malept commented Apr 13, 2018

@Mani0608 please limit your discussion to the bug so that it's easier to follow along, questions about his project should go in his issue tracker.

The "succeed" bug is #331.

Back to the repro steps, I want to confirm that this happens with a minimal app, so it can be reproduced by someone who's willing to fix the bug. Does this hanging behavior happen for you if you create a fresh Forge project, don't add any new dependencies, and run npm run package?

@mkndn
Copy link

mkndn commented Apr 13, 2018

@malept Thanks for the response.
Yes it does happen with a fresh forge project too.. I created the project using

npx electron-forge init sample-app
cd sample-app
npm start (worked)
npm run package (stuck at the same position)

But it did complete on a couple of occasions but after 1+ hours. Does it have to do anything with permissions? Because i faced some permission issues while installing electron-forge plugin as a global plugin, with rename package.json steps. But with multiple tries i manage to install it (under roaming/npm/node_modules). Is this related to the issue i'm facing?

@malept
Copy link
Member

malept commented Apr 13, 2018

I can't reproduce this on Linux (Debian Stretch) or macOS (10.13.3) (I don't have access to a Windows install right now). I made sure to run npx --ignore-existing electron-forge init sample-app instead of your first line so that it wouldn't use the existing Forge that I already had installed. Both times npm run package took under a minute.

@mkndn
Copy link

mkndn commented Apr 13, 2018

Does it have to do anything with global plugins that i have installed Or the number of angular dependencies? I tried

npm cache clean
npm cache verify

nothing worked out. I have removed and installed electron-forge a number of times, but every time i tried to install, i'm facing the permission issue with rename package.json.

@malept
Copy link
Member

malept commented Apr 13, 2018

You shouldn't need to install Electron Forge globally. Using npx to create the project should be sufficient, Forge is added into devDependencies.

@mkndn
Copy link

mkndn commented Apr 13, 2018

I tried the command with --ignore-existing flag and still getting the "Permission Error".
I'm going to try it in my personal laptop and see how it behaves.

@mkndn
Copy link

mkndn commented Apr 13, 2018

I created a new project on my personal laptop with electron-forge init. Everything ran smooth and the packaging took between 2 to 3 minutes to complete. I will try the same with my actual project and share the results here. For now, i believe its an issue with my work-pc

@mkndn
Copy link

mkndn commented Apr 14, 2018

OK. I moved the entire application (angular 5, node server) to my personal laptop. Now the packaging completes within 10 minutes (better compared to 1 hour previously). But now i'm getting some error

Compiling ApplicationFailed to compile file: C:\Users\mani0\AppData\Local\Temp\electron-packager\win32-x64\script-generator-win32-x64\resources\app\src\typings.d.ts Debug Failure. False expression: Output generation failed

But the packaging is successful. When i tried to run the application, i'm getting the following error,

image

I'm using the compilerc from electron-forge-template (angular2) here

@mkndn
Copy link

mkndn commented Apr 14, 2018

When i used the default compilerc from electron-forge, i ended up getting the following errors,

Cannot find module 'caniuse-lite/dist/unpacker/agents' electron-forge

and when i opened the application after packaging, i got the following error,

image

@mkndn
Copy link

mkndn commented Apr 15, 2018

I tried packaging app directly using electron-packager that came with electron-forge and the application works fine. That confirms no issues with configuration or my code. There is something seriously wrong with electron-forge and i need help in resolving issues reported in my previous posts.

@mkndn
Copy link

mkndn commented Apr 15, 2018

I found the root cause of the "getSync" issue. Its because of es6-shim.js
When i manually change the main file in package.json to my main.js, then the application works fine. But what is the workaround to avoid this issue during "electron-forge make".

@okonet
Copy link

okonet commented Apr 16, 2018

I'm experience the same issue. It was working for me before until recently it just stopped. So even if I check out commits from 3 months ago that I could build successfully, I can't package the app anymore.

➜ DEBUG=electron-packager electron-forge package
✔ Checking your system
⠋ Preparing to Package Application for arch: x64  electron-packager Electron Packager 10.1.0 +0ms
  electron-packager Node v9.8.0 +0ms
  electron-packager Host Operating system: darwin (x64) +0ms
  electron-packager Packager Options: {"asar":{"unpackDir":"{src/scripts,node_modules/node-notifier/vendor}"},"overwrite":true,"packageManager":"yarn","icon":"resources/icon","ignore":[".idea","coverage"],"appBundleId":"com.koolesache.CodeStage","appCategoryType":"public.app-category.productivity","afterCopy":[null,null,null],"afterExtract":[],"afterPrune":[null],"dir":"/Users/okonet/Projects/codestage","arch":"x64","platform":"darwin","out":"/Users/okonet/Projects/codestage/out","electronVersion":"1.8.2-beta.3","quiet":true} +0ms
  electron-packager Target Platforms: darwin +1ms
  electron-packager Target Architectures: x64 +0ms
  electron-packager Inferring application name from name in /Users/okonet/Projects/codestage/package.json +0ms
  electron-packager Inferring appVersion from version in /Users/okonet/Projects/codestage/package.json +1ms
  electron-packager Application name: codestage +5ms
  electron-packager Target Electron version: 1.8.2-beta.3 +0ms
  electron-packager Ignored path regular expressions: [ '.idea',
  'coverage',
  '/node_modules/electron($|/)',
  '/node_modules/electron-prebuilt(-compile)?($|/)',
  '/node_modules/electron-packager($|/)',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$' ] +0ms
⠙ Preparing to Package Application for arch: x64

and it stays there forever.

@mkndn
Copy link

mkndn commented Apr 16, 2018

@okonet At the point, the script is copying all the contents of your node_modules directory to ".../APPDATA/LOCAL/Temp/electron-packager/../" path and then removes/prunes the unnecessary/unwanted (devDependencies). In case your dependencies have grown recently or any macafee/antivirus, this can happen. I had to move entire application from my work-pc to my personal laptop to improve the speed.

@okonet
Copy link

okonet commented Apr 16, 2018

Nope, I didn’t do anything with my dependencies. I didn’t work on my projects for a couple of months and now it’s not building anymore.

@mkndn
Copy link

mkndn commented Apr 16, 2018

Can you please provide more details on the electron-forge version and your compilerc configuration. I can see you are using an older version of electron-packager. Is it a react or angular application? In case you are using angular, there is a separate compilerc configuration here

@okonet
Copy link

okonet commented Apr 25, 2018

@Mani0608 I'm using React and here is my config:

"config": {
    "forge": {
      "make_targets": {
        "darwin": [
          "zip"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn",
        "icon": "resources/icon",
        "ignore": [
          ".idea",
          "coverage"
        ],
        "appBundleId": "com.koolesache.CodeStage",
        "appCategoryType": "public.app-category.productivity",
        "asar": {
          "unpackDir": "{src/scripts,node_modules/node-notifier/vendor}"
        }
      },
      "electronWinstallerConfig": {
        "name": "codestage"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "okonet",
        "name": "codestage"
      }
    }
  }

You can checkout the repo and try it: https://github.com/okonet/codestage

@okonet
Copy link

okonet commented Apr 25, 2018

Super frustrated now since I tried pinning dependencies and still can't make it work. It was working a few weeks ago. Any ideas where to look?

@malept
Copy link
Member

malept commented May 3, 2018

It works for me on Linux. Does it hang if you use Travis CI's macOS workers?

@okonet
Copy link

okonet commented May 3, 2018

I’m using it locally on macOS

@malept
Copy link
Member

malept commented May 3, 2018

My question is really, can you reproduce this error on another macOS instance somewhere? Travis CI is just one way of accomplishing this.

@okonet
Copy link

okonet commented May 28, 2018

Right now I don’t have Travis CI setup but I’ll try later.

@zlw123
Copy link

zlw123 commented Nov 20, 2020

@malept can you help me ?
I am having the same problem. It sticks at "Preparing to Package Application for arch: x64".

E:\isanedu\isan_electron\test>yarn make
yarn run v1.19.1
$ electron-forge make
√ Checking your system
√ Resolving Forge Config
We need to package your application before we can make it

  • Preparing to Package Application for arch: x64 electron-packager Electron Packager 15.1.0
    electron-packager Node v14.15.1
    electron-packager Host Operating system: win32 10.0.18363 (x64) +0ms
    electron-packager Packager Options: {"asar":false,"overwrite":true,"dir":"E:\isanedu\isan_electron\test","arch":"x64","platform":"win32","afterCopy":[null],"afterExtract":[null],"afterPrune":[null],"out":"E:\isanedu\isan_electron\test\out","electronVersion":"11.0.2","quiet":true} +1ms
    electron-packager Target Platforms: win32 +1ms
    electron-packager Target Architectures: x64 +1ms
    electron-packager Requiring author in package.json, as CompanyName was not specified for win32metadata +0ms
    electron-packager Inferring application name from productName in E:\isanedu\isan_electron\test\package.json +8ms
    electron-packager Inferring appVersion from version in E:\isanedu\isan_electron\test\package.json +1ms
    electron-packager Inferring win32metadata.CompanyName from author in E:\isanedu\isan_electron\test\package.json +2ms
    electron-packager Application name: test +18ms
    electron-packager Target Electron version: 11.0.2 +3ms
    electron-packager Ignored path regular expressions: [ '/\.git($|/)', '/node_modules/\.bin($|/)', '\.o(bj)?$' ] +0ms
    / Preparing to Package Application for arch: x64

package.json

{
"name": "test",
"productName": "test",
"version": "1.0.0",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo "No linting configured""
},
"keywords": [],
"author": {
"name": "zhouliwei",
"email": "[email protected]"
},
"license": "MIT",
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "test"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.54",
"@electron-forge/maker-deb": "^6.0.0-beta.54",
"@electron-forge/maker-rpm": "^6.0.0-beta.54",
"@electron-forge/maker-squirrel": "^6.0.0-beta.54",
"@electron-forge/maker-zip": "^6.0.0-beta.54",
"electron": "11.0.2"
}
}

@malept
Copy link
Member

malept commented Nov 24, 2020

@zlw123 Unfortunately, due to the limited amount of time of the maintainers and the limited amount of information present in your question, we cannot help debug your app at this time. Instead, you should consider using one of the community forums, as there are more people there available to answer questions.

@electron electron locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants