question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Packager runs slower due to moving the app between drives, lots of dependencies, and using NPM

See original GitHub issue
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue: I cloned the electron quick start project, and then run this command: set DEBUG=electron-packager && electron-packager ./ --arch=x64 --platform=win32 (in windows 10) to package it. However, it takes me 40 seconds to finish!!! And when I used it in my real electron app, it takes FOREVER to finish…

From the output below, I am very confused about two things:

  • The time it claims to cost is not equal to what it actually costs. For example, the last 2 line says +235ms but in fact several seconds.
  • Why does it take such a long time? Why the whole task take ~1min? Why the rename task takes +14s? Shouldn’t rename as fast as a flash?

Additional information: it seems that these two things takes really long time:

  • prune.
  • copy the folder from temporary location to the dist location.

PS. About half a month before, I ran this command and the speed was good. The electron-quick-start can be packaged very fast, and my project can be packaged in less than 1min.

It really drives mad, so if anyone can help, I would really appreciate it!!! Thank you guys!!!

Console output when you run electron-packager with the environment variable DEBUG=electron-packager. Please include the stack trace if one exists.

The output is like this (I have marked where it stucks) :


	D:\Swap\electron-quick-start>set DEBUG=electron-packager && electron-packager ./ electron --arch=x64 --platform=win32 --overwrite --no-prune
	  electron-packager Electron Packager 8.7.2 +0ms
	  electron-packager Node v7.4.0 +0ms
	  electron-packager Host Operating system: win32 (x64) +0ms
	  electron-packager Packager Options: {"_":["./","electron"],"all":false,"deref-symlinks":true,"download":{"strictSSL":true},"overwrite":true,"prune":false,"quiet":false,"arch":"x64","platform":"win32","dir":"./","name":"electron","protocols":[]} +0ms
	  electron-packager Target Platforms: win32 +16ms
	  electron-packager Target Architectures: x64 +0ms
	  electron-packager Inferring appVersion from version in D:\Swap\electron-quick-start\package.json +10ms
	  electron-packager Inferring target Electron version from electron in D:\Swap\electron-quick-start\package.json +5ms
	  electron-packager Application name: electron +1ms
	  electron-packager Target Electron version: 1.6.12 +0ms
	  electron-packager Ignored path regular expressions: [ '/node_modules/electron($|/)',
	  '/node_modules/electron-prebuilt(-compile)?($|/)',
	  '/node_modules/electron-packager($|/)',
	  '/\\.git($|/)',
	  '/node_modules/\\.bin($|/)',
	  '\\.o(bj)?$' ] +1ms
	  electron-packager Downloading Electron with options {"strictSSL":true,"platform":"win32","arch":"x64","version":"1.6.12"} +3ms
	Packaging app for platform win32 x64 using electron v1.6.12
	  electron-packager Creating C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64-template +7s
	  electron-packager Extracting C:\Users\fzyzcjy\.electron\electron-v1.6.12-win32-x64.zip to C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64-template +0ms
	  electron-packager Initializing app in C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64\electron-win32-x64 from C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64-template template +1s
	 
	  ** STUCK HERE **
	  
	  electron-packager Ignored paths based on the out param: [ 'D:\\Swap\\electron-quick-start\\electron-darwin-ia32',
	  'D:\\Swap\\electron-quick-start\\electron-darwin-x64',
	  'D:\\Swap\\electron-quick-start\\electron-darwin-armv7l',
	  'D:\\Swap\\electron-quick-start\\electron-linux-ia32',
	  'D:\\Swap\\electron-quick-start\\electron-linux-x64',
	  'D:\\Swap\\electron-quick-start\\electron-linux-armv7l',
	  'D:\\Swap\\electron-quick-start\\electron-mas-ia32',
	  'D:\\Swap\\electron-quick-start\\electron-mas-x64',
	  'D:\\Swap\\electron-quick-start\\electron-mas-armv7l',
	  'D:\\Swap\\electron-quick-start\\electron-win32-ia32',
	  'D:\\Swap\\electron-quick-start\\electron-win32-x64',
	  'D:\\Swap\\electron-quick-start\\electron-win32-armv7l' ] +0ms
	  
	  ** STUCK HERE **
	  
	  electron-packager Pruning modules via: npm prune --production +15s
	  
	  ** STUCK HERE TOO **
	  
	  electron-packager Renaming electron.exe to electron.exe in C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64\electron-win32-x64 +14s
	  electron-packager Running rcedit with the options {"version-string":{},"file-version":"1.0.0","product-version":"1.0.0"} +0ms
	  electron-packager Moving C:\Users\fzyzcjy\AppData\Local\Temp\electron-packager\win32-x64\electron-win32-x64 to D:\Swap\electron-quick-start\electron-win32-x64 +235ms
	
	  ** STUCK HERE TOO **
	
	Wrote new app to D:\Swap\electron-quick-start\electron-win32-x64

What command line arguments are you passing? Alternatively, if you are using the API, what parameters are you passing to the packager() function?

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

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem. Using electron-quick-start is a good starting point.

Just run the command above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
maleptcommented, Aug 15, 2017

Another thing you can try is installing yarn and then using --package-manager=yarn.

1reaction
maleptcommented, Aug 15, 2017

There is an flag in Packager called --tmpdir.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is "npm install" really slow? - node.js - Stack Overflow
I installed modules here in less than 1 min with your package. json with npm v3.
Read more >
nodejs and yarn are 4x slower on windows than ubuntu #17
From my experience this appears to be related to disk performance and is not specific to npm: using npm to install new packages...
Read more >
Dependency Managers Don't Manage Your Dependencies
Taking Ownership of Dependencies · Analyze dependencies · Remove unused dependencies · Keep dependencies up-to-date · Clean up duplicated packages ...
Read more >
Common errors | npm Docs
Possible temporary npm registry glitch, or corrupted local server cache. Run npm cache clean and/or try again later. · This can be caused...
Read more >
Yarn vs NPM: A Comprehensive Comparison - phoenixNAP
Yarn and NPM are among the most popular package managers for JavaScript developers working with Node.js. Here is what makes them different.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found