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

Help in building app without downloading electron from github #2448

Closed
myfrndjk opened this issue Jan 7, 2018 · 14 comments
Closed

Help in building app without downloading electron from github #2448

myfrndjk opened this issue Jan 7, 2018 · 14 comments
Labels

Comments

@myfrndjk
Copy link

myfrndjk commented Jan 7, 2018

19.52.1

  • Version: No
2.9.4
  • Target: windows

When I try to build electron in my environment linux host I am getting following error.
getaddrinfo ENOTFOUND github.com github.com:443

On checking the log I found that builder is trying to download electron from github instead of using it from dependencies.Is there a way to use electron which is present inside node_modules or how do i fix that getaddrinfo ENOTFOUND github.com github.com:443 issue, I guess that issue caused by proxy issue.

Thanks
Jk

@develar
Copy link
Member

develar commented Jan 7, 2018

Please see https://github.com/electron-userland/electron-download about setting mirror or cache location.

@myfrndjk
Copy link
Author

myfrndjk commented Jan 7, 2018

Hi,

Thanks for reply I read that unfortunately cant make it work.
I tried this line in my package.json
"release": "set ELECTRON_CACHE=/root/.cache/electron && set ELECTRON_CUSTOM_DIR=./node_modules/electron/ && chmod -R +x node_modules && build --win --publish always",

Still it tries to download electron from github only.
It would be great if you provide some sample / right way of doing it.

Error


GENERIC > set ELECTRON_CACHE=/root/.cache/electron && set ELECTRON_CUSTOM_DIR=./node_modules/electron/ && chmod -R +x node_modules && build --win --publish always

GENERIC
GENERIC electron-builder 19.28.4
GENERIC No native production dependencies
GENERIC Packaging for win32 x64 using electron 1.7.6 to dist/win-unpacked
GENERIC Downloading tmp-1613-0-electron-v1.7.6-win32-x64.zip
GENERIC [>                                            ] 0.0% (0 B/s)
GENERIC �[1000D�[0K�[1A�[1000D�[0K�[1A�[1000D�[0KDownloading tmp-1613-0-electron-v1.7.6-win32-x64.zip
GENERIC Error: getaddrinfo ENOTFOUND github.com github.com:443
GENERIC Error: getaddrinfo ENOTFOUND github.com github.com:443 

Thanks
Jk

@Ajeey
Copy link
Contributor

Ajeey commented Jan 7, 2018

You can set the mirror via package.json

"build": {
   "electronDownload": {
      "mirror": "https://xxx/electron-binaries/",
      "quiet": false,
      "verifyChecksum": false
    }
}

@myfrndjk
Copy link
Author

myfrndjk commented Jan 7, 2018

@Ajeey Thanks for the help.It helped to an extend.Seems download is not supported in by host.
Is there a way to use downloaded/local electron.zip file for build.
I added electron zip inside resources and tried below code


    "electronDist":"resources/electronzipfiles/",
    "electronDownload": {
      "quiet": false,
      "verifyChecksum": false,
      "cache":"~/.cache/electron/"
    } 

Now it is not trying to download electron by tries to download codesign and again fails.
If i tries to add codesign.z inside resources no use still it is trying to download from git hub.
Not sure how to add those dependencies in local

Thanks
Jk

@myfrndjk
Copy link
Author

myfrndjk commented Jan 8, 2018

similar issue #1859

This is how my release script looks like
"release": "mkdir -p ~/.cache/electron-builder && chmod -R 777 ~/.cache/electron-builder && cp -r resources/electronbuilder/* ~/.cache/electron-builder && chmod -R +x node_modules && build --win --publish always",

I manually downloaded winCodeSign-1.9.0and pushed that inside ~/.cache/electron-builder
But electron builder is still try to download that from github and throws error

  electron-builder 19.28.4
 No native production dependencies
 Packaging for win32 x64 using electron 1.7.6 to dist/win-unpacked
 Downloading winCodeSign-1.9.0, please wait
 Warning: Cannot download winCodeSign, attempt #1: Error: getaddrinfo ENOTFOUND github.com github.com:443
 Error: getaddrinfo ENOTFOUND github.com github.com:443 

Am I missing any steps

Thanks
Jk

@mandyr
Copy link

mandyr commented Mar 27, 2018

@myfrndjk were you able to solve this issue? I am facing the same problem with winCodeSign-1.9.0 and I took the same steps you did.

@develar
Copy link
Member

develar commented Mar 27, 2018

@mandyr Please try version 20.8.0

@rajshak123
Copy link

@develar I also have the same issue.It downloads electron from repo even though i already have electron in npm_modules.Is there any flag which can point to local installation of electron instead of downloading it everytime a new build is initiated?

@GKSONG
Copy link

GKSONG commented Mar 11, 2020

In my case (electron-builder : 20.44.4), the following configuration works.

C:\Users\xxx\AppData\Local\electron-builder\cache
winCodeSign\winCodeSing-2.4.0
nsis\nsis-3.0.3.2
nsis\nsis-resources-3.3.0

@amt-work
Copy link

@GKSONG Can you post the package.json you used to make this work? I'm struggling trying to figure it out.

@jzybert
Copy link

jzybert commented Aug 27, 2021

+1 for the package.json if you still have it

@vanminhquangtri
Copy link

@myfrndjk have you solved the problem yet? I got same problem and would like to hear any advice from you. Thank you.

@myfrndjk
Copy link
Author

Hi all,

I never solved this issue.
Thanks

@vanminhquangtri
Copy link

Thank @myfrndjk
For me it works when in package.json, add build property. assets is the folder where we place the zip file of electron.


"build": {
    "electronDownload": {
      "cache": "./assets",
      "isVerifyChecksum": false,
      "platform": "win32"
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants