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
Uncaught Error: EPERM: operation not permitted, write #2033
Comments
@zcbenz thank you! So here is what I discovered using dev tools: In Windows 8.1, this is my code causing the problem:
[Good] When I run electron from the command line, this code works without a problem and I see 'hi' in my command prompt. [Bad] When I run a packaged version of my app by running the .exe I get this error:
I think this makes sense because there is no stdout to write to since there is no attached command prompt? I inspected the Any ideas on how I could go about solving this one? Would love to use this as a learning opportunity for me as well as to help improve Electron. Thanks! |
That's because on Windows a GUI program does not have console attached when it is not opened in console, which means you actually don't have stdout. So writing to stdout under this situation will throw the exception. |
@zcbenz is there anyway for me to programmatically detect whether or not there is a console attached? |
There should be some win32 API for this, but I think the best solution is to use console.log for logging, writing to stdout is quite tricky on Windows. |
My solution is pretty bad, but will do this for now until I learn more about win32 APIs for detecting if stdout is available to write to.
|
@kirkouimet i've this problem with sql.js that use stdout. |
I had this issue with the |
Hi, I solved it like this: |
I'm getting this error in Windows 8.1 when I run my app using the .exe:
When I run my app from the command line it works with no problem.
Any ideas on what could be causing the permissions issue or the best way on how I can debug it further?
The text was updated successfully, but these errors were encountered: