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

packager stops without any messages on a Windows host platform #544

Closed
ZoolWay opened this issue Dec 15, 2016 · 45 comments
Closed

packager stops without any messages on a Windows host platform #544

ZoolWay opened this issue Dec 15, 2016 · 45 comments
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 build-host:windows Running Electron Packager on Windows

Comments

@ZoolWay
Copy link

ZoolWay commented Dec 15, 2016

When I try to package my simple application ( https://github.com/ZoolWay/electron-typescript-aurelia-starter ) I run:

D:\Daten\Tech Files\Development\electron-typescript-aurelia-starter>electron-packager . --platform=win32 --arch=x64
  electron-packager Electron Packager 8.3.0 +0ms
  electron-packager Node v6.6.0 +0ms
  electron-packager Host Operating system: win32 (x64) +0ms
  electron-packager Packager Options: {"_":["."],"all":false,"deref-symlinks":true,"download":{"strictSSL":true},"overwrite":false,"prune":true,"platform":"win32","arch":"x64","dir":".","protocols":[]} +0ms
  electron-packager Target Platforms: win32 +0ms
  electron-packager Target Architectures: x64 +0ms
  electron-packager Inferring application name from name in D:\Daten\Tech Files\Development\electron-typescript-aurelia-starter\package.json +15ms
  electron-packager Inferring app-version from version in D:\Daten\Tech Files\Development\electron-typescript-aurelia-starter\package.json +0ms
  electron-packager Inferring target Electron version from electron-prebuilt in D:\Daten\Tech Files\Development\electron-typescript-aurelia-starter\package.json +0ms
  electron-packager Application name: electron-typescript-aurelia-starter +0ms
  electron-packager Target Electron version: 1.4.10 +0ms
  electron-packager Ignored path regular expressions: [ '/node_modules/electron($|/)',
  '/node_modules/electron-prebuilt($|/)',
  '/node_modules/electron-packager($|/)',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$' ] +0ms
  electron-packager Downloading Electron with options {"strictSSL":true,"platform":"win32","arch":"x64","version":"1.4.10"} +6s
Packaging app for platform win32 x64 using electron v1.4.10
  electron-packager Creating C:\Users\ZoolWay\AppData\Local\Temp\electron-packager\win32-x64-template +243ms
  electron-packager Extracting C:\Users\ZoolWay\.electron\electron-v1.4.10-win32-x64.zip to C:\Users\ZoolWay\AppData\Local\Temp\electron-packager\win32-x64-template +4ms
  electron-packager Initializing app in C:\Users\ZoolWay\AppData\Local\Temp\electron-packager\win32-x64\electron-typescript-aurelia-starter-win32-x64 from C:\Users\ZoolWay\AppData\Local\Temp\electron-packager\win32-x64-template template +1s
  electron-packager Ignored paths based on the out param: [ 'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-darwin-ia32',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-darwin-x64',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-darwin-armv7l',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-linux-ia32',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-linux-x64',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-linux-armv7l',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-mas-ia32',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-mas-x64',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-mas-armv7l',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-win32-ia32',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-win32-x64',
  'D:\\Daten\\Tech Files\\Development\\electron-typescript-aurelia-starter\\electron-typescript-aurelia-starter-win32-armv7l' ] +17ms

Then it finishes without anything else to say. I am back at my console shell, no output generated.

As you see I call it like this:

electron-packager . --platform=win32 --arch=x64

The pure electron-quick-start works but not with this project of myself. Most confusing is exiting without any error message.

@malept malept added the needs info Issue reporter needs to provide more information for maintainers to take action label Dec 15, 2016
@malept
Copy link
Member

malept commented Dec 15, 2016

Hrm. Try setting DEBUG=*and then pasting the Electron Packager output in a gist (because that's the ultra verbose setting).

@malept malept added the build-host:windows Running Electron Packager on Windows label Dec 15, 2016
@malept malept changed the title packager stops without any messages packager stops without any messages on a Windows host platform Dec 15, 2016
@ZoolWay
Copy link
Author

ZoolWay commented Dec 15, 2016

Thanks @malept , did not know about DEBUG=*.

Here is the gist: https://gist.github.com/ZoolWay/bee85209aacc45e4114de155b78919f5

To me looks like it is just stopping in the middle of things.

@malept
Copy link
Member

malept commented Dec 15, 2016

That is extremely strange. The last two debug lines should be flipped, for one.

It looks like your temporary directory is on a different drive than your app's working directory. Could you try having your working directory on the same drive as your temporary directory? (It shouldn't matter, but I have a bad feeling about this.)

@ZoolWay
Copy link
Author

ZoolWay commented Dec 15, 2016

I updated the gist using the tmpdir option to use D:\tmp - so everything should be on drive D:. No success.

Also I moved the folder directly under D:\ to have no space in the path and a shorter name. Still no success.

@malept
Copy link
Member

malept commented Dec 16, 2016

I still think this is Windows-specific. Is it possible to try with a different host platform? (keep the target the same)

@ZoolWay
Copy link
Author

ZoolWay commented Dec 16, 2016

I have now tried a different machine but I only got Win 10 machines here. The same result.

Also note that the same command line works for the electron-quickstart project (cloned, npm installed, packaged) - so I am not sure.

Failing the packaging without any error, thats really strange.

I might be able to test it in a Linux VM but not before Sunday. But you could try with my repo by yourself if you got a minute to spare ( https://github.com/ZoolWay/electron-typescript-aurelia-starter ).

Otherwise I will come back after a Linux test. Let me know if I can try something else or make it more verbose in any way.

@ZoolWay
Copy link
Author

ZoolWay commented Dec 16, 2016

Ok, found an old VM with Ubuntu and installed nodejs, etc. plus wine.

Building the linux package works and building the win32-x86 package works there too. I updated the gist with the log (DEBUG=*) from the latter in case it helps.

@malept
Copy link
Member

malept commented Dec 16, 2016

Fair warning, since this appears to be a Windows-specific issue, it may be a while before I find the time to boot up a Windows VM and debug this.

If you would to try debugging this yourself, this is what I'm going to do: put a bunch of debug statements in the initializeApp and win32 code and see which function call it runs before it stops.

@dougestey
Copy link

Interestingly, this also fails using https://github.com/Microsoft/BashOnWindows

@malept
Copy link
Member

malept commented Jan 12, 2017

Yeah, I imagine it's Windows-internals-specific.

I still haven't found time to debug this and would appreciate someone else who's motivated to follow the instructions in my earlier comment and post the results here.

@mmmmeng3
Copy link

> [email protected] package C:\Users\Jiaqin Meng\GamempireApp\client
> electron-packager ./ Gamempire --overwrite --app-version=1.0.0 --platform=win32 --arch=all --out=../demo --version=electronVersion

The version parameter is deprecated, use electronVersion instead
Packaging app for platform win32 ia32 using electron v1.4.13`

then it is crashed for no reason and no error log appears.i am looking for a solution to package

@malept
Copy link
Member

malept commented Jan 19, 2017

@mmmmeng3

--version=electronVersion

That's not what that deprecation message means. Use --electron-version instead of --version. This will be clearer in the next release.

I still need a volunteer to debug this.

@mmmmeng3
Copy link

i dont know if this help. i add flag with --ignore=node_,modules. it solves all my problem.

@ZoolWay
Copy link
Author

ZoolWay commented Jan 20, 2017

I tried --ignore=node_modules too and at least I get a package now. Have to verify if the others errors are mine or by packager.

@malept
Copy link
Member

malept commented Jan 20, 2017

It would really help if someone could make a minimal testcase that reproduces the problem. Using the electron-quick-start repository as a base, could someone please create a minimal Electron app that illustrates this issue, and post a link to it here? The repository linked in the issue summary has far too many dependencies to figure out which in the dependency tree might be causing this.

@englishextra
Copy link

englishextra commented Jan 20, 2017

@malept

I cloned electron-quick-start on windows 10 desktop.

https://github.com/electron/electron-quick-start

Then in cmd:

npm install
C:\Users\serguei\Desktop\electron-quick-start>npm install

> [email protected] postinstall C:\Users\serguei\Desktop\electron-quick-start\node_modules\electron
> node install.js

[email protected] C:\Users\serguei\Desktop\electron-quick-start
`-- [email protected]
  +-- [email protected]
  | +-- [email protected]
  | | `-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | `-- [email protected]
  | |   `-- [email protected]
  | |     +-- [email protected]
  | |     +-- [email protected]
  | |     | `-- [email protected]
  | |     +-- [email protected]
  | |     | `-- [email protected]
  | |     |   +-- [email protected]
  | |     |   `-- [email protected]
  | |     `-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | `-- [email protected]
  | | |   +-- [email protected]
  | | |   | `-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   | +-- [email protected]
  | | |   | | `-- [email protected]
  | | |   | `-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   | +-- [email protected]
  | | |   | +-- [email protected]
  | | |   | | `-- [email protected]
  | | |   | `-- [email protected]
  | | |   |   +-- [email protected]
  | | |   |   | `-- [email protected]
  | | |   |   `-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   | +-- [email protected]
  | | |   | `-- [email protected]
  | | |   |   +-- [email protected]
  | | |   |   | +-- [email protected]
  | | |   |   | | `-- [email protected]
  | | |   |   | |   `-- [email protected]
  | | |   |   | +-- [email protected]
  | | |   |   | `-- [email protected]
  | | |   |   |   `-- [email protected]
  | | |   |   `-- [email protected]
  | | |   +-- [email protected]
  | | |   | +-- [email protected]
  | | |   | | `-- [email protected]
  | | |   | |   `-- [email protected]
  | | |   | `-- [email protected]
  | | |   `-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | `-- [email protected]
  | | |   +-- [email protected]
  | | |   | `-- [email protected]
  | | |   `-- [email protected]
  | | |     `-- [email protected]
  | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | | +-- [email protected]
  | | | | | +-- [email protected]
  | | | | | +-- [email protected]
  | | | | | `-- [email protected]
  | | | | +-- [email protected]
  | | | | | `-- [email protected]
  | | | | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   `-- [email protected]
  | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | +-- [email protected]
  | | | | | +-- [email protected]
  | | | | | +-- [email protected]
  | | | | | `-- [email protected]
  | | | | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   | `-- [email protected]
  | | | |   +-- [email protected]
  | | | |   +-- [email protected]
  | | | |   `-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | +-- [email protected]
  | | | | `-- [email protected]
  | | | +-- [email protected]
  | | | `-- [email protected]
  | | +-- [email protected]
  | | | `-- [email protected]
  | | |   +-- [email protected]
  | | |   +-- [email protected]
  | | |   | `-- [email protected]
  | | |   `-- [email protected]
  | | |     `-- [email protected]
  | | `-- [email protected]
  | +-- [email protected]
  | | `-- [email protected]
  | |   `-- [email protected]
  | +-- [email protected]
  | | +-- [email protected]
  | | +-- [email protected]
  | | `-- [email protected]
  | +-- [email protected]
  | `-- [email protected]
  |   `-- [email protected]
  `-- [email protected]
    +-- [email protected]
    | +-- [email protected]
    | +-- [email protected]
    | | +-- [email protected]
    | | +-- [email protected]
    | | +-- [email protected]
    | | +-- [email protected]
    | | `-- [email protected]
    | `-- [email protected]
    +-- [email protected]
    +-- [email protected]
    | `-- [email protected]
    `-- [email protected]
      `-- [email protected]
        `-- [email protected]


C:\Users\serguei\Desktop\electron-quick-start>
npm start

2017-01-20_223839

@malept
Copy link
Member

malept commented Jan 20, 2017

@englishextra that doesn't actually reproduce the problem. You need to modify electron-quick-start to be packageable.

@englishextra
Copy link

@malept I was not going to reproduce the problem. I just confirmed that quick start works and placed the log of cmd for you to see the deps so that you can have the picture. The case is particular so the dev only knows where to dig into.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

I am experiencing the same problem on Windows 10 64 bit. Packaging the same project works fine on OSX.

Here is my log: https://gist.github.com/arekkas/bee174bac37357a8910f48693fd5a1b7

@malept
Copy link
Member

malept commented Feb 16, 2017

To be clear to future commenters: this only affects Windows.

@arekkas thank you for the log.

This confirms my suspicion from my earlier comment. Someone who has this problem, please try the following: put a bunch of debug statements in the initializeApp function (inside common.js) and win32.js file and see which function call it runs before it stops.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

My suspicion is a long path issue in one of the node modules. Nothing concrete yet though.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

@malept so apparently we make it past the last statement in common.js:

initializeApp()
// ...
    series(operations, function (err) {
      console.log('cb err', err) // this is never being called
      if (err) return callback(err)
      callback(null, tempPath)
    })
    console.log('end') // this gets executed
  },

but we're not making it in the callback in win32.js:

  createApp: function createApp (opts, templatePath, callback) {
    common.initializeApp(opts, templatePath, path.join('resources', 'app'), function buildWinApp (err, tempPath) {
      console.log('init cb') // we don't make it until here

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

I've tried this hack to debug which operation is causing the trouble, it seems like it's operation 1:

    series(operations.map((o, k) => (args) => {
      console.log('operation', k) // prints "operation 0", "operation 1"
      return o(args)
    }), function (err) {
      if (err) return callback(err)
      callback(null, tempPath)
    })

@malept
Copy link
Member

malept commented Feb 16, 2017

@arekkas, I appreciate you taking the time to look at this. This is the first operation. This is the second. I take it you're saying it's the second (because 0-based indexes)?

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

@malept yes, it's the second. although it seems that we're finishing that one too. my guess is that fs.copy is not calling the callback. I tried wrapping it in a try/catch block which doesn't say anything either. I'm currently investigating if it's a path issue or something.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

ok, now it threw an error:

EPERM: operation not permitted, open 'D:\Temp\electron-packager\win32-x64\ORY Sites App-win32-x64\resources\app\.git\objects\05\f8aed8fed644d5c291c1a73b90366152964b24'

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

Ah, scrap my last comment. It was caused by me removing the options from fs.copy(opts.dir, appPath, {filter: ignore.userIgnoreFilter(opts), dereference: shouldDeref}, cb): fs.copy(opts.dir, appPath, cb). When I add it, same thing happens (it just quits) without any notice.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

Could this be the cause?

@malept
Copy link
Member

malept commented Feb 16, 2017

@arekkas Nope, I haven't even released that yet 😄

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

Ok, damnit. :D

So I just tried this:

        try {
          fs.copy(opts.dir, appPath, {filter: ignore.userIgnoreFilter(opts), dereference: shouldDeref}, () => {
            console.log('GOT CALLED BACK')
          })
        } catch (e) {
          console.error(e)
        }

which yields...nothing. So I guess it's something with the copy task that doesn't call the callback properly.

@malept
Copy link
Member

malept commented Feb 16, 2017

@arekkas just for completeness's sake, could you try with Electron Packager master? I want to make sure it's still a problem in the latest fs-extra before I go asking that you escalate this to the upstream module's issue tracker.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

how does that work, npm i electron-packager@master?

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

I investigated if the issue is with spaces in the path (D:\Temp\electron-packager\win32-x64\ORY Sites App-win32-x64\resources\app) but it's not. I used the electron template with the same name and packaging that worked. One more indicator that this could be a long filename issue (it's in fs.copy, it's not reproducible with the boilerplate app, it's not the tmp path)

@malept
Copy link
Member

malept commented Feb 16, 2017

I think you can just say npm install $GIT_URL.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

Adding "electron-packager": "git+https://github.com/electron-userland/electron-packager.git", in the package.json did the trick. :)

Unfortunately, the issue persists on the master branch.

@aeneasr
Copy link

aeneasr commented Feb 16, 2017

upstream: jprichardson/node-fs-extra#358

Let's see what they say.

@malept
Copy link
Member

malept commented Feb 16, 2017

@arekkas thanks for filing the issue, it is greatly appreciated.

@malept malept added blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 and removed needs info Issue reporter needs to provide more information for maintainers to take action labels Feb 16, 2017
@aeneasr
Copy link

aeneasr commented Feb 16, 2017

Thank you for being so responsive, not a lot of maintainers are!

@aeneasr
Copy link

aeneasr commented Feb 20, 2017

Try upgrading to node 7.6.0. It seems to be working with that one!

@lauriebonete
Copy link

Any leads on this one? I'm stuck with the same issue for one of my projects. But my another project for win32 is completing without any issue.

@malept
Copy link
Member

malept commented Mar 9, 2017

Evidently, try the latest Node 7.

@lauriebonete
Copy link

I updated to Node 7.7.2 and it is now working as expected. Now that's a relief.

Thanks!

@malept
Copy link
Member

malept commented Mar 9, 2017

I'm going to close this, since there's a workaround and it appears to be a Node problem, not an Electron Packager problem.

@C0ZEN
Copy link

C0ZEN commented May 25, 2017

I don't know why but --ignore=node_modules fixed my problem, thanks to @mmmmeng3.
Without it, the only thing I get from the run was :

Packaging app for platform win32 x64 using electron v1.6.8.

With it :

Packaging app for platform win32 x64 using electron v1.6.8
Wrote new app to release-app\cogeo-app-win32-x64

@apexearth
Copy link

Adding --ignore=node_modules fixed my build issue, though I needed a package in there.
Deleting my node_modules folder and then reinstalling with npm i fixed my problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 build-host:windows Running Electron Packager on Windows
Projects
None yet
Development

No branches or pull requests

9 participants