Attachconsole failed with error 6

not working #9


kerolloz commented Jun 26, 2019

when the app starts it only shows a blank screen

The text was updated successfully, but these errors were encountered:

plutoless commented Jun 27, 2019

any console logs?

Mohamed-Fakhry commented Jun 27, 2019

Console logs

plutoless commented Jun 27, 2019

Are you running this repository demo w/o modifications? Which platform are you running on? Windows?

plutoless commented Jun 27, 2019

Sorry i see you are running on Mac. Could you pls double check if there’s any file exists under /Users/mohamedfakhry/Desktop/Agora-Electron-Quickstart-master/node_modules/agora-electron-sdk/build/Release

kerolloz commented Jun 27, 2019

I tried it on Linux

Mohamed-Fakhry commented Jun 27, 2019

build/Release not exist

Mohamed-Fakhry commented Jun 27, 2019 •

We tried it on Linux and macOS

plutoless commented Jun 27, 2019

Hi unfortunately our electron-sdk now only works on macOS + windows.
On MacOS if it’s not working for you, could you pls remove node_modules/agora-electron-sdk, run npm i —verbose, and share the install logs with me?

Mohamed-Fakhry commented Jun 27, 2019

Thank you work fine now, AgoraIO will support Linux ?

plutoless commented Jun 27, 2019

there’s no plan yet to support linux for now. @Mohamed-Fakhry

ONwaiting commented Oct 7, 2019

Errors are also reported in Windows

ONwaiting commented Oct 7, 2019

plutoless commented Oct 7, 2019

@ONwaiting please take a look if the specified missing files actually exists in your file system or not

kongliya commented Oct 9, 2019 •

Errors are also reported in Windows

I have the same problem as you now.
Electron_version: «5.0.8»

plutoless commented Oct 9, 2019

is your electron version 5.0.8 ? could you pls paste your npm install logs

kongliya commented Oct 9, 2019

我之前用npm一直安装失败,然后用yarn安装成功的,但是看到之前评论说必须npm安装 我现在重新安装报这个错了.

plutoless commented Oct 9, 2019

kongliya commented Oct 9, 2019

agora-electron-sdk@2.9.0-hotfix.2 install d:\Agora-Electron-Quickstart\node_modules\agora-electron-sdk
just install

[2:49:37 PM] ■ started ‘install’
[2:49:37 PM] ■ Package Version: 2.9.0
[2:49:37 PM] ■ Platform: win32
[2:49:37 PM] ■ Electron Version: 5.0.8
[2:49:37 PM] ■ Download URL :

[2:49:37 PM] ■ Downloading prebuilt C++ addon for Agora Electron SDK.

[2:49:37 PM] ■ finished ‘install’ in 0.04s

kl@DESKTOP-F0FH3QD MINGW64 /d/Agora-Electron-Quickstart (master)
$ npm run dev

electron-webpack-quick-start@0.0.0 dev d:\Agora-Electron-Quickstart
electron-webpack dev

AttachConsole failed with error 6: �������

Hash: 3d300dc3761c8720b740
Version: webpack 4.39.2
Time: 740ms
Built at: 2019-10-09 2:51:41 PM
Asset Size Chunks Chunk Names
main.js 42 KiB main [emitted] main
Entrypoint main = main.js
[0] multi ./node_modules/electron-webpack/out/electron-main-hmr/main-hmr ./src/main/index.js 40 bytes

[./node_modules/electron-webpack/out/electron-main-hmr/main-hmr.js] 582 bytes
[./src/main/index.js] 1.51 KiB
[electron] external «electron» 42 bytes
[electron-webpack/out/electron-main-hmr/HmrClient] external «electron-webpack/out/electron-main-hmr/HmrClient» 42 bytes
[path] external «path» 42 bytes
[source-map-support/source-map-support.js] external «source-map-support/source-map-support.js» 42 bytes
[url] external «url» 42 bytes

Читайте также:  Parse error syntax error unexpected что это значит

i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from d:\Agora-Electron-Quickstart\static, d:\Agora-Electron-Quickstart\dist\renderer-dll

i 「wdm」: Hash: dee93e32d1102e1f2dc9
Version: webpack 4.39.2
Time: 3252ms
Built at: 2019-10-09 2:51:49 PM
Asset Size Chunks Chunk Names
index.html 425 bytes [emitted]
renderer.js 4.65 MiB renderer [emitted] renderer
styles.css 210 KiB renderer [emitted] renderer
Entrypoint renderer = styles.css renderer.js
[1] multi (webpack)-dev-server/client?http://localhost:59885 (webpack)/hot/dev-server.js css-hot-loader/hotModuleReplacement ./src/renderer/index.js 64 bytes [built]
[./node_modules/bulma/css/bulma.css] 294 bytes [built]
[./node_modules/css-hot-loader/hotModuleReplacement.js] 3.05 KiB [built]
[./node_modules/css-hot-loader/node_modules/normalize-url/index.js] 3.85 KiB [built]
[./node_modules/lodash/debounce.js] 5.96 KiB [built]
[./node_modules/react-dom/index.js] 1.33 KiB [built]
[./node_modules/react/index.js] 190 bytes [built]
[./node_modules/strip-ansi/index.js] 161 bytes [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:59885] (webpack)-dev-server/client?http://localhost:59885 4.29 KiB [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.85 KiB [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes [built]
[./node_modules/webpack/hot/dev-server.js] (webpack)/hot/dev-server.js 1.59 KiB [built]
[./src/renderer/index.js] 218 bytes [built]
+ 69 hidden modules
Child html-webpack-plugin for «index.html»:
Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js??ref—6-2!src/renderer/index.css:
Entrypoint mini-css-extract-plugin = *
[./node_modules/css-loader/dist/cjs.js. /src/renderer/index.css] ./node_modules/css-loader/dist/cjs.js??ref—6-2!./src/renderer/index.css 552 bytes [built]
[./node_modules/css-loader/dist/runtime/api.js] 2.61 KiB [built]

i 「wdm」: Compiled successfully.

┗ —————————-
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (d:\Agora-Electron-Quickstart\node_modules\electron\index.js:14:11)
at Object. (d:\Agora-Electron-Quickstart\node_modules\electron\index.js:18:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at startElectron (d:\Agora-Electron-Quickstart\node_modules\electron-webpack\src\dev\dev-runner.ts:156:33)
at DevRunner.start (d:\Agora-Electron-Quickstart\node_modules\electron-webpack\src\dev\dev-runner.ts:67:5)
at process._tickCallback (internal/process/next_tick.js:68:7)

我又重新来了一遍. 上次好像是这个报错 @@我把electron删了重新装的,我现在还需要这么做么?help. Thanks.


AttachConsole failed with error 6 Renderer Error #307


AaronBeaudoin commented Jul 30, 2019

Every time I run electron-webpack dev is get the following renderer error: AttachConsole failed with error 6: The handle is invalid.

Nothing I’ve tried has been able to remove this warning, and it seems to be resulting in another warning later when I close my app: CtrlC(): GenerateConsoleCtrlEvent failed with error 6: The handle is invalid. Again, both of these warning are marked as being from the renderer process.

I’m on Windows 10 using Node 8.11.1 and electron-webpack 2.7.4.

Any help would be much appreciated.

The text was updated successfully, but these errors were encountered:

loopmode commented Jul 30, 2019

I usually just ignore those 🙂 looking forward for hints and solutions tho!

Suniron commented Nov 12, 2019

@AaronBeaudoin I have the same issue 🙁 . Did you solved it?

b-zurg commented Nov 14, 2019

I actually don’t think this is a huge issue but it is certainly is annoying. I couldn’t find much about the error when digging through Any help would be appreciated but in the meantime it’s a working dev environment.

loopmode commented Nov 14, 2019 •

Does somebody on Mac or Linux have this issue, or is it a Windows thing?

Читайте также:  The process was terminated due to an unhandled exception net

loopmode commented Nov 14, 2019 •

I ask because I suspect this is related to runnerw.exe which is used:
We have this other issue of Ctrl+c not killing the webpack process correctly, which is definitely because of runnerw.exe.
And, I tried once to simply not use runnerw.exe despite of being on Windows, and it actually still worked fine for me, plus Ctrl+C killed all processes.

I’m curious to know if it helps with this warning as well. I’ll try and report if i find the time, feel free to try as well. Just edit the file in node_modules and remove the special treatment for Windows.

Suniron commented Nov 14, 2019

Yes it’s only on Windows for me. The same project has no error on Ubuntu or Raspbian

b-zurg commented Nov 14, 2019

I just tried on mac also. Totes a Windows thing.

loopmode commented Nov 14, 2019 •

Well then, as mentioned in #249 (comment) we might provide an opt-out of runnerw.exe. while it would be elegant to do it via config, it would be much much simpler via env var. And it would solve the zombie child process problem. However, I’m not sure what we would lose, apparently something about low level signal propagation. In my quick test, everything seemed to work fine but I think we should do some more testing. Since I’m currently actively working with electron-webpack again, I’ll give this some time tomorrow. Would be awesome if you guys could join in and also try it out.

(On the other hand, there’s not much to lose if it’s just an opt-out).

loopmode commented Nov 18, 2019

As suspected, not using runnerw.exe on windows helps.

loopmode commented Nov 18, 2019

If you use cmd.exe , this problem doesn’t occur. It only happens when you use e.g. git bash.

It seems that when electron-webpack checks for win32 platform, it assumes cmd.exe and launches child processes via runnerw.exe . This is good for cmd.exe , however I would bet that most or at least many developers on windows use git bash instead. Still checking if we should control this behaviour via env variable (e.g. ELECTRON_WEBPACK_USE_RUNNERW or ELECTRON_WEBPACK_SKIP_RUNNERW ). It would be better to detect that we are indeed inside cmd.exe instance.

Suniron commented Nov 19, 2019

I have tried with cmd.exe and the problem is here also..
Same with Powershell, Cmder.
I must launch my command yarn dev in Admin mode because i’m on profesional computer..

loopmode commented Nov 19, 2019 •

Hm okay then. Hmm. Then I cannot be sure that skipping runnerw.exe will help without somebody cross-checking, seems my local situation is not reliable enough. @Suniron since you’re already taking time for this.. could you maybe check? See my link to a comment in #249 , there is a isWin check in DevRunner. You could just disable it inside installed node_modules and re-test.

Читайте также:  Error encountered while communicating with primary target ip address 10060

b-zurg commented Jan 20, 2020

I just tried this out. In ChildProcessManager.js in my node_modules I changed this function

and the message

was gone. But instead the renderer failed to compile. This is on running electron-webpack dev

The main bundle compiled fine funnily enough.
I’m using git bash as a side-note.

loopmode commented Jan 25, 2020

When I tried it, I completely removed the isWin:
return (0, _child_process().spawn)(program, args, options);
And both main and renderer seemed fine.


AttachConsole function

Attaches the calling process to the console of the specified process as a client application.



dwProcessId [in]
The identifier of the process whose console is to be used. This parameter can be one of the following values.

Value Meaning
pid Use the console of the specified process.
ATTACH_PARENT_PROCESS (DWORD)-1 Use the console of the parent of the current process.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


A process can be attached to at most one console. If the calling process is already attached to a console, the error code returned is ERROR_ACCESS_DENIED. If the specified process does not have a console, the error code returned is ERROR_INVALID_HANDLE. If the specified process does not exist, the error code returned is ERROR_INVALID_PARAMETER.

A process can use the FreeConsole function to detach itself from its console. If other processes share the console, the console is not destroyed, but the process that called FreeConsole cannot refer to it. A console is closed when the last process attached to it terminates or calls FreeConsole. After a process calls FreeConsole, it can call the AllocConsole function to create a new console or AttachConsole to attach to another console.

This function is primarily useful to applications that were linked with /SUBSYSTEM:WINDOWS, which implies to the operating system that a console is not needed before entering the program’s main method. In that instance, the standard handles retrieved with GetStdHandle will likely be invalid on startup until AttachConsole is called. The exception to this is if the application is launched with handle inheritance by its parent process.

To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers.


Оцените статью