microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.42k stars 233 forks source link

Uncaught Exception: winpty-conout-... at PipeConnectWrap.afterConnect #598

Closed JaryGuo closed 1 year ago

JaryGuo commented 1 year ago

Environment details

today I encounter the exception:

Uncaught Exception:
Error: connect ENOENT
winpty-conout-....
at PipeConnectWrap.afterConnect [as oncomplete] (netjs:1146:16)

and i try to debug the code in WindowsPtyAgent and finaly found that

this._useConpty = this._getWindowsBuildNumber() >= 18309;

is not correct for win11, which log out the version 60?? (sorry i debug in other colleague‘s computer)

and currently i just modified the code to this._useConpty = true; as in my teams, all computer os should be newer than 18309..

Issue description

Tyriar commented 1 year ago

You're saying _getWindowsBuildNumber() is returning 60? I've never seen this, here's what is run, can you try debug it to see where 60 comes from?

https://github.com/microsoft/node-pty/blob/ae441595fbe59ebceb742cfb5bde5844b6c99626/src/windowsPtyAgent.ts#L213-L218

JaryGuo commented 1 year ago

i debug the electron app today, and the os.release() print out "6.0.6002"

it's weird. and i log out the os.release() in the node.js console, the result is "10.0.22621".

JaryGuo commented 1 year ago

it seems to be the bug of nodejs

https://github.com/nodejs/node-v0.x-archive/issues/25896