Can't launch node process from cygwin
leeight opened this issue · 15 comments
$ node
net.js:157
this._handle.open(options.fd);
^
Error: EINVAL, invalid argument
at new Socket (net.js:157:18)
at process.stdin (node.js:660:19)
at startup (node.js:145:16)
at node.js:901:3
node --version 0.10.21
cygwin isn't officially supported
That's caused by cygwin's terminal emulation, it's incompatible with node. Closing as WONTFIX. If you feel really strongly about it, you could try your hand at a libuv patch.
Hangs in Powershell ISE.
Works fine with powershell.exe.
Works for me if I don't use rlwrap.
$ rlwrap node
net.js:157
this._handle.open(options.fd);
^
Error: EINVAL, invalid argument
at new Socket (net.js:157:18)
at process.stdin (node.js:660:19)
at startup (node.js:145:16)
at node.js:902:3
$ node -e "console.log('hello node')"
hello node
$ node
>
Note that you can still use node with cygwin, just not in the mintty terminal. For example you can start cygwin from the Windows command shell or from a third party terminal like Console, and then use node normally.
@paulcw Good to know. Thanks.
i can confirm, that i run node in cygwin in a console tab, as described here.
This is not good enough unfortunately, as I need to ssh into my cygwin shell from a mac and need to be able to run node there. Unfortunately, all those terminal and console solutions won't help here. We need nodejs to please add support for Cygwin natively!
@salqadri The problem running node on cygwin, at least the one I observed, is with the default terminal app. The solution above (run with a different terminal app) is simply a workaround of that problem.
But if you're planning to run via a SSH as you describe, then you wouldn't even be running a cygwin terminal app, and you'd be working around the problem already.
So if you tried to run node like that and it hasn't worked, it's probably a different problem, or a different manifestation of the problem than I've seen mentioned anywhere. Have you tried it yet? If so, how are you running sshd? What error messaes do you get?
(btw, is there a better place for convos like this than a github bug entry?)
Hi @paulcw, I'm attempting to run node 0.10.33
in a manner very similar to @salqadri . I'm running sshd from cwgwin on a Window Server 2012 R2 machine. I get the exact same error as the OP when running node from a cygwin terminal or when I ssh in from a linux machine. Your workaround with a windows prompt and Cygwin.bat
works for me. Any idea how I can use this workaround for my ssh session? Thanks.
I am still getting this via cygwin/SSH.
Was that supposed to be fixed by the above commit/latest version?
I need this to work for Jenkins builds which uses SSH to run stuff on windows box... are there any usable workarounds for this scenario?
$ node
net.js:157
this._handle.open(options.fd);
^
Error: EINVAL, invalid argument
at new Socket (net.js:157:18)
at process.stdin (node.js:687:19)
at startup (node.js:145:16)
at node.js:929:3
$ node -v
v0.10.35
And yes, this will work in windows cmd command prompt.
@jpastuszek Simply open command prompt or powershell and run cygwin from there.
Unless it is easy to fix I vote this should stay closed node.js was intended for Unix and then ported to Windows. Cygwin isn't even in the list of supported programs.
C:\> C:\cygwin\cygwin.bat
a@pc ~
$ node
> console.log("test")
test
simply invoke node as the following:
$ node -i
Cygwin isn't even in the list of supported programs .... so sad...
I have occasionally found that creation of mintty.bat helps
Just put it near to the mintty.exe at C:\Program Files\Git\usr\bin
with the next content
mintty bash --login -i
Or for the task bar's shortcut change a property from
"C:\Program Files\Git\usr\bin\mintty.exe"
to
"C:\Program Files\Git\usr\bin\mintty.exe" bash --login -i