EPERM: operation not permitted, lstat electron.zip in windows due to corporate proxy preventing download
See original GitHub issuePreflight Checklist
- 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 a bug that matches the one I want to file, without success.
Issue Details
When trying to create an exe-File by using electron-packagr the following message gets displayed:
EPERM: operation not permitted, lstat 'C:\TEMP\electron-download-rCu75g\electron-v1.8.8-win32-x64.zip'
I run the following command: electron-packager . --overwrite --DEBUG=* --platform=win32 --arch=x64 --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="MyApp" ``
- Electron Packager Version: 14.0.0
- Electron Version: 1.8.8
- Operating System: Windows 7 SP1
- Last Known Working Electron Packager version:: I do not know. It was 2018 when i last build that application but since then I deleted it and reinstalled.
Expected Behavior
To build the exe File
Actual Behavior
Builds nothing
To Reproduce
I am a restricted user because of company guidelines. Also I operate behind a corporate proxy.
Additional Information
This changes nothing of the output.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:29 (6 by maintainers)
Top Results From Across the Web
EPERM: operation not permitted, lstat electron.zip in windows ...
EPERM : operation not permitted, lstat electron.zip in windows due to corporate proxy preventing download.
Read more >npm - EPERM: operation not permitted on Windows
Today I got EPERM even in cmd.exe . But I ran the following command standing in C:\Program Files\nodejs , and it seems to...
Read more >Cordova res Error EPERM operation not permitted
Sometimes the tasks end up giving the EPERM: operation not permitted error ... lstat electron.zip in windows due to corporate proxy preventing download...
Read more >How To Fix npm Error Eperm Operation Not Permitted Mkdir ...
Hello Guys! In this tutorial ,I provided the complete solution of React JS Framework Error :npm - EPERM : operation not permitted on...
Read more >Error: EPERM: operation not permitted, mkdir 'C:\Users\Chirag' Code ...
copyFile( options[0], locallAppdata+'\\Microsoft\\Windows\\Fonts\\' + options[0], (err) =>{ ... Answers related to “Error: EPERM: operation not permitted, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Story I’ve finally solved this problem with a work around after running debug mode on the source code of two files under
my-app\node_modules\electron\
, these two files areinstall.js
andindex.js
. After hours of digging, I really want to share this with you guys.I am running windows 10 on my work laptop. I’ve ask my colleagues to try installing electron under corporate network, they can all run it with no problem. So at least in my case, this error is not caused by firewalls or other corporate network related setting.
Understand the Problem (please skip directly to solution is not interested) The nature of this problem as @kolomu suggested, is a connection problem from my computer to the github server hosting the electron zip file. There are two strategies to make it work without fixing the connection to the github server:
I only explored solution2 because I am not familiar with building local host in solution1. If you can, by all means use solution1 because you can then reuse it for other apps without manually repeat solution2.
Steps for Solution2
your-app\
, runnpm install electron
. This will give you the well known ‘operation not permitted’ error. This is just to make sure you have theyour-app\node_modules\electron
directory. If you already have, skip this step.dist\
directory underyour-app\node_modules\electron
so you haveyour-app\node_modules\electron\dist\
your-app\node_modules\electron\dist\
. Make sure the contents are not in extra folder but directly underdist\
. If it is done correctly, you should be able to finddist\electron.exe
.path.txt
file underyour-app\node_modules\electron
electron.exe
inpath.txt
file and save. This is becasue at run time,your-app\node_modules\electron\index.js
is reading frompath.txt
to get the executable name of electron, which iselectron.exe
.your-app\
, runnpm start
. Now your app should run and an electron window should show up if you are using theelectron-quick-start
as your app. You can find the app here. I would recommend starting with this demo app, because you know the app itself works, which isolates the electron installation problem.Wish everyone good luck and please let me know if you have any questions.
Happy coding!
Had the same problem and did some debugging.
Turns out, if you set ELECTRON_GET_USE_PROXY then @electron/get uses global-agent as proxy lib. global-agent in turn uses the env variable GLOBAL_AGENT_HTTP_PROXY to determine the proxy address.
Setting both resolved the issue for me!