Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Can't launch node process from cygwin #6459

Closed
leeight opened this issue Nov 4, 2013 · 15 comments
Closed

Can't launch node process from cygwin #6459

leeight opened this issue Nov 4, 2013 · 15 comments

Comments

@leeight
Copy link

leeight commented Nov 4, 2013

$ 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

@juliangruber
Copy link
Member

cygwin isn't officially supported

@bnoordhuis
Copy link
Member

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.

@DanOlivier
Copy link

Hangs in Powershell ISE.
Works fine with powershell.exe.

@roanosullivan
Copy link

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
>

@paulcw
Copy link

paulcw commented Feb 10, 2014

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.

@roanosullivan
Copy link

@paulcw Good to know. Thanks.

@ccoenen
Copy link

ccoenen commented Aug 29, 2014

i can confirm, that i run node in cygwin in a console tab, as described here.

@salqadri
Copy link

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!

@paulcw
Copy link

paulcw commented Sep 16, 2014

@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?)

@chevett
Copy link

chevett commented Nov 12, 2014

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.

@jpastuszek
Copy link

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.

@smnpaorg
Copy link

smnpaorg commented Mar 4, 2015

@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

@zyonet
Copy link

zyonet commented Jul 16, 2015

simply invoke node as the following:

$ node -i

@xiaoping378
Copy link

Cygwin isn't even in the list of supported programs .... so sad...

@it3xl
Copy link

it3xl commented Dec 25, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests